Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Oct 2018 02:23:29 +0000
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        FreeBSD Filesystems <freebsd-fs@freebsd.org>, Josh Paetzel <josh@tcbug.org>, Andriy Gapon <avg@FreeBSD.org>
Subject:   Re: How to fill in the fsid for file systems?
Message-ID:  <YTOPR0101MB11621427AF47133A93311E16DDCD0@YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM>
In-Reply-To: <20181030012240.GM5335@kib.kiev.ua>
References:  <YTOPR0101MB11620BAF0E206EE36E927A5ADDF30@YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM>, <20181030012240.GM5335@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
Konstantin Belousov wrote:
>On Mon, Oct 29, 2018 at 03:56:02PM +0000, Rick Macklem wrote:
>> Hi,
>>
>> I have been working with Josh Paetzel on a patch to add support for
>> the "fsid=3DN" 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.)
>Why do you consider this an option for exports file and not for nmount(2)
>and fstab ?  Do you intend to mangle fsid for mount protocol only ?
Well, Josh Paetzel proposed this. I believe it was because "that's how Linu=
x
does it" (but I can't speak for Josh).

The kernel code currently sets this via an nmount(2) option called "export.=
fsid".
Although Josh's patch has this done in mountd.c, it could simply be used as
a mount option in /etc/fstab or manual mounting. (The code currently proces=
ses
this option in vfs_domount_update(), so it would need to be moved to where
options are processed during mounting, but that wouldn't be hard.)

This would actually avoid patching mountd.c. It would also avoid the fact t=
hat
the "export fsid option" applies to all clients and is not per-host or per-=
net.
(Doing it only for "exports" requires a moderate amount of code change, suc=
h
as a new function to be used instead of vfs_busyfs() to busy the file syste=
m
after looking up the fsid in the export stuff. I haven't coded this, so I'm=
 not
sure how much work that would be?)

I actually think making it a generic nmount(2) option and not an export spe=
cific
one sounds like a good idea.

What do others think of making "fsid=3DN" a generic mount option for
overriding the selection of fsid done by the file system?

rick
ps: Although I don't try to be "Linux incompatible", I don't see why we sho=
uld
      be compatible when doing it a slightly different way seems more logic=
al.





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