Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Oct 2018 15:56:02 +0000
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        FreeBSD Filesystems <freebsd-fs@freebsd.org>
Subject:   How to fill in the fsid for file systems?
Message-ID:  <YTOPR0101MB11620BAF0E206EE36E927A5ADDF30@YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM>

next in thread | raw e-mail | index | archive | help
Hi,

I have been working with Josh Paetzel on a patch to add support for the "fs=
id=3DN"
option (like what Linux has) to /etc/exports. (It is used to ensure that th=
e fsid
for a file system doesn't change when migrated to a different machine, so t=
hat
file handles don't change.)

We have code that seems to work, but it is not obvious what should be fille=
d
in to f_fsid.val[1]?
- cd9660 and msdosfs just set it to vfc_typenum
- ZFS sets the low order 8bits to vfc_typenum and the high order 24 bits to=
 the
  high order bits of its "56bit objset unique ID"
- UFS uses a value fs_id[1] in the superblock that appears to be filled in =
with a
  random value at fs creation time by newnfs(8).

It seems "fsid=3DN" does need to set f_fsid.val[1]. I can think of two poss=
ibilities:
1 - Do what ZFS does and set the low order 8bits to vfc_typenum and the hig=
h
      order 24bits from bits 32->55 of "N".
or
2 - Just fill the 32bits in with the high order (32->63) bits of "N" and fo=
rget about
     vfc_typenum.
The only reason I can see for using vfc_typenum is to avoid collisions (sam=
e fsid value)
with fsids for mounts of other file system types.

What do others think? rick




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YTOPR0101MB11620BAF0E206EE36E927A5ADDF30>