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>
index | next in thread | raw e-mail
Hi,
I have been working with Josh Paetzel on a patch to add support for the "fsid=N"
option (like what Linux has) to /etc/exports. (It is used to ensure that the fsid
for a file system doesn't change when migrated to a different machine, so that
file handles don't change.)
We have code that seems to work, but it is not obvious what should be filled
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=N" does need to set f_fsid.val[1]. I can think of two possibilities:
1 - Do what ZFS does and set the low order 8bits to vfc_typenum and the high
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 forget about
vfc_typenum.
The only reason I can see for using vfc_typenum is to avoid collisions (same fsid value)
with fsids for mounts of other file system types.
What do others think? rick
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YTOPR0101MB11620BAF0E206EE36E927A5ADDF30>
