Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Nov 2018 09:17:13 +0200
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Rick Macklem <rmacklem@uoguelph.ca>, Konstantin Belousov <kostikbel@gmail.com>
Cc:        FreeBSD Filesystems <freebsd-fs@FreeBSD.org>, Josh Paetzel <josh@tcbug.org>
Subject:   Re: How to fill in the fsid for file systems?
Message-ID:  <a831d660-1ed9-ef21-f457-8e1e986b96f2@FreeBSD.org>
In-Reply-To: <YTOPR0101MB116207BA89FB66EE9B1AAF01DDCD0@YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM>
References:  <YTOPR0101MB11620BAF0E206EE36E927A5ADDF30@YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM> <20181030012240.GM5335@kib.kiev.ua> <YTOPR0101MB11621427AF47133A93311E16DDCD0@YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM> <e7813a64-59c2-67a1-3471-b32a6ca42ef8@FreeBSD.org> <YTOPR0101MB116207BA89FB66EE9B1AAF01DDCD0@YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM>

next in thread | previous in thread | raw e-mail | index | archive | help
On 31/10/2018 17:50, Rick Macklem wrote:
> I alluded to this option in my last post. I think both fsids will need to be in the
> mount structure, since finding the correct mount point via the fsid is the first
> step in translating a file handle to a vnode. (After that VFS_FHTOVP() does the rest.)
>
> And I think it will get messy. A couple of examples.
> There are some syscalls that use file handles. fhopen(2), fhstat(2), fhstatfs(2),
> getfh(2), lgetfh(2)
> I had assumed that the "file handles" used by these should be the same file
> handles that NFS uses (ie. file handles are a generic VFS component and not NFS
> specific) but I can see the argument either way. I actually don't know what
> apps/utilities use fhopen/fhstat/fhstatfs, but getfh(2) is used by mountd.
> Since mountd uses getfh(2) to get a file handle for NFS mounts, it needs to
> return the NFS fsid to keep the old binaries working, even if you add a
> new getnfsfh(2) function for mountd to use.
> - Now you have some file handle system calls using file handles with the NFS
>   fsid in them and some using file handles with the "true" fsid in them.
>   (Sounds confusing to me.)
> 
> Since the first step in turning a file handle into a vnode is looking up the fsid
> in the mount list, if you had two fsids, I think they both would end up in the
> mount structure so that lookup could be done easily.
> This lookup is normally done by vfs_busyfs() { that appears to be the only use
> of vfs_busyfs() in sys/kern. I haven't looked in the various file systems }.
> With two fsids, you need two functions and need to be careful which one you use.

I originally thought about having a separate filesystem list for NFS that would
contain only exported filesystems.  But I suspect that managing it could be
problematic.

An alternative idea is to use osd(9) framework to attach NFS specific data to
struct mount without modifying the structure and without exposing the NFS data
to other consumers.

-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a831d660-1ed9-ef21-f457-8e1e986b96f2>