All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Richard Weinberger <richard@nod.at>
Cc: linux-nfs@vger.kernel.org, luis.turcitu@appsbroker.com,
	chris.chilvers@appsbroker.com, david.young@appsbroker.com,
	daire@dneg.com, david.oberhollenzer@sigma-star.at,
	david@sigma-star.at, trond.myklebust@hammerspace.com,
	anna.schumaker@netapp.com
Subject: Re: [RFC PATCH 0/3] Dealing with NFS re-export and cross mounts
Date: Tue, 11 Jan 2022 15:01:37 -0500	[thread overview]
Message-ID: <20220111200137.GD4035@fieldses.org> (raw)
In-Reply-To: <20220111194337.GC4035@fieldses.org>

On Tue, Jan 11, 2022 at 02:43:37PM -0500, J. Bruce Fields wrote:
> On Mon, Jan 10, 2022 at 07:44:16PM +0100, Richard Weinberger wrote:
> > rpc.mountd could:
> > a) re-use the fsid from the original NFS server.
> >    Beside of requesting this information, the problem with that approach is
> >    that the original fsid might conflict with an existing export.
> > b) derive the fsid from stat->st_dev.
> > c) allocate a free fsid.
> >  
> > One use case to consider is load balancing. When multiple NFS servers re-export
> > a NFS mount, they need to use the same fsid for crossed mounts.

I guess if rpc.mountd kept an on-disk database of fsid's, it wouldn't be
too big a deal to later enhance that with the option of a distributed
database.

So I'm leaning towards picking a random fsid and sticking it in a
database.  When you encouter a new filesystem you'd need to make sure
the addition of a new entry is atomic and persistent before returning to
knfsd.

It'd be nice if mountd had an easy way to query the on-the-wire fsid
from userspace, and then you could index entries on the fsid.  Absent
that, maybe just indexing on server and path would be good enough.

I'm not sure how NFS's st_dev's are generated.  I think they might
depend on stuff that isn't necessarily the same on each boot (like the
order the NFS filesystems were mounted in), so they wouldn't work.

--b.

> > So I'm a little puzzled which approach is best. What do you think?
> > 
> > Known issues:
> > - Only tested with NFSv3 (both server and client) so far.
> > 
> > [0] https://marc.info/?l=linux-nfs&m=161653016627277&w=2
> > 
> > Richard Weinberger (3):
> >   NFSD: Teach nfsd_mountpoint() auto mounts
> >   fs: namei: Allow follow_down() to uncover auto mounts
> >   NFS: nfs_encode_fh: Remove S_AUTOMOUNT check
> > 
> >  fs/namei.c      | 2 +-
> >  fs/nfs/export.c | 5 -----
> >  fs/nfsd/vfs.c   | 2 +-
> >  3 files changed, 2 insertions(+), 7 deletions(-)
> > 
> > -- 
> > 2.26.2

  reply	other threads:[~2022-01-11 20:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10 18:44 [RFC PATCH 0/3] Dealing with NFS re-export and cross mounts Richard Weinberger
2022-01-10 18:44 ` [RFC PATCH 1/3] NFSD: Teach nfsd_mountpoint() auto mounts Richard Weinberger
2022-01-10 18:44 ` [RFC PATCH 2/3] fs: namei: Allow follow_down() to uncover " Richard Weinberger
2022-01-10 18:44 ` [RFC PATCH 3/3] NFS: nfs_encode_fh: Remove S_AUTOMOUNT check Richard Weinberger
2022-01-11 19:43 ` [RFC PATCH 0/3] Dealing with NFS re-export and cross mounts J. Bruce Fields
2022-01-11 20:01   ` J. Bruce Fields [this message]
2022-01-11 20:02 ` J. Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220111200137.GD4035@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=anna.schumaker@netapp.com \
    --cc=chris.chilvers@appsbroker.com \
    --cc=daire@dneg.com \
    --cc=david.oberhollenzer@sigma-star.at \
    --cc=david.young@appsbroker.com \
    --cc=david@sigma-star.at \
    --cc=linux-nfs@vger.kernel.org \
    --cc=luis.turcitu@appsbroker.com \
    --cc=richard@nod.at \
    --cc=trond.myklebust@hammerspace.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.