All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Frank Filz" <ffilzlnx@mindspring.com>
To: "'NeilBrown'" <neilb@suse.de>
Cc: "'J. Bruce Fields'" <bfields@fieldses.org>,
	"'Chuck Lever'" <chuck.lever@oracle.com>,
	<linux-nfs@vger.kernel.org>,
	"'Josef Bacik'" <josef@toxicpanda.com>
Subject: RE: [PATCH v2] BTRFS/NFSD: provide more unique inode number for btrfs export
Date: Fri, 27 Aug 2021 19:21:59 -0700	[thread overview]
Message-ID: <005d01d79bb3$7b914c10$72b3e430$@mindspring.com> (raw)
In-Reply-To: <163010850148.7591.14454473128413118273@noble.neil.brown.name>

> On Sat, 28 Aug 2021, Frank Filz wrote:
> 
> > > On Sat, 28 Aug 2021, Frank Filz wrote:
> > > >
> > > > Changing the fsid for sub-volumes is Ganesha's solution (before
> > > > adding that, we couldn't even export the sub-volumes at all).
> > >
> > > What does Ganesha use for the mounted-on-fileid? There doesn't seem
> > > to be an "obvious" answer so I wonder what was chosen.
> >
> > We only make mounted_on_fileid different from fileid on our export
> > boundaries, and even then, it's not a terribly correct thing for
> > FSAL_VFS (our module for interfacing with kernel filesystems) since
> > user space to my knowledge has no way to get any information on an
> > inode that serves as a mount point.
> 
> It is possible to see the mounted-on inode number by doing a readdir() of the
> parent directory and looking at d_ino.  It is a bit round-about.

Ahh, I'll have to keep that in mind, I'm not totally sure, but I think AIX mostly used/got the mounted_on_fileid during a READDIR which if that translates into a readdir to the underlying filesystem (via getdents in our case) then we have the d_ino to fill in mounted_on_fileid. I think it's less likely a situation with a LOOKUP. I think AIX used it when it got NFS4ERR_WRONGSEC when doing a READDIR, it would then go back and do a READDIR just asking for mounted_on_fileid (which as a property of the owning directory, we decided was OK to give for an inode that was in a new export with different security flavor requirements). I think AIX used the mounted_on_fileid to instantiate some kind of junction inode in the directory.

> >
> > What clients actually do anything with mounted_on_fileid, and what
> > sorts of things do they do with it? I know the AIX client was
> > interested in it (from having worked on security negotiation back in
> > 2006), but I have never been able to test Ganesha with an AIX client.
> > For normal Linux client operations, what Ganesha does seems to work
> > OK.
> 
> On the Linux client, if you stat() a directory that is a mountpoint on the server,
> you will see a directory with the inode number being the mounted-on-fileid.
> That directory is an automount-point, and when you access anything in it, the
> 'real' directory gets mounted and the mounted-on-fileid disappears.
> So if you reported a mounted-on-fileid the same as the fileid, which would be
> 256 on btrfs, du and find can get confused.  To be safe, the mounted-of-fileid
> needs to be different to all ancestors.
> 
> NeilBrown

Frank


  reply	other threads:[~2021-08-28  2:22 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26  4:28 [PATCH] NFSD: drop support for ancient file-handles NeilBrown
2021-08-26  6:03 ` [PATCH v2] BTRFS/NFSD: provide more unique inode number for btrfs export NeilBrown
2021-08-26 20:19   ` J.  Bruce Fields
2021-08-26 22:10     ` NeilBrown
2021-08-27 14:53       ` Frank Filz
2021-08-27 22:57         ` NeilBrown
2021-08-27 23:46           ` Frank Filz
2021-08-27 23:55             ` NeilBrown
2021-08-28  2:21               ` Frank Filz [this message]
2021-08-27 18:32       ` J.  Bruce Fields
2021-08-27 23:01         ` NeilBrown
2021-08-27 16:20   ` Christoph Hellwig
2021-08-27 23:05     ` NeilBrown
2021-08-28  7:09       ` Christoph Hellwig
2021-08-31  4:59         ` NeilBrown
2021-09-01  7:20           ` Christoph Hellwig
2021-09-01 15:22             ` J. Bruce Fields
2021-09-02  4:14               ` NeilBrown
2021-09-05 16:07                 ` J. Bruce Fields
2021-09-06  1:29                   ` NeilBrown
2021-09-11 14:12                     ` Amir Goldstein
2021-09-13  0:43                       ` NeilBrown
2021-09-13 10:04                         ` Amir Goldstein
2021-09-13 22:59                           ` NeilBrown
2021-09-14  5:45                             ` Amir Goldstein
2021-09-20 22:09                               ` NeilBrown
2021-09-02  7:11               ` Christoph Hellwig
2021-09-02  4:06             ` NeilBrown
2021-09-02  7:16               ` Christoph Hellwig
2021-09-02  7:53                 ` Miklos Szeredi
2021-09-02 14:16                   ` Frank Filz
2021-09-02 23:02                     ` NeilBrown
2021-08-26 14:10 ` [PATCH] NFSD: drop support for ancient file-handles Chuck Lever III
2021-08-26 21:38   ` NeilBrown
2021-08-26 14:51 ` J.  Bruce Fields
2021-08-26 21:41   ` NeilBrown
2021-08-27 15:15 ` Christoph Hellwig
2021-08-27 23:24   ` NeilBrown
2021-08-31  4:41   ` [PATCH 1/2 v2] NFSD: drop support for ancient filehandles NeilBrown
2021-08-31  4:42     ` [PATCH 2/2] NFSD: simplify struct nfsfh NeilBrown
2021-09-01  7:44       ` Christoph Hellwig
2021-09-01  7:44     ` [PATCH 1/2 v2] NFSD: drop support for ancient filehandles Christoph Hellwig
2021-09-01 14:21       ` Chuck Lever III
2021-09-02  1:14         ` [PATCH 1/3 v3] NFSD: move filehandle format declarations out of "uapi" NeilBrown
2021-09-02  1:15           ` [PATCH 2/3 v3] NFSD: drop support for ancient filehandles NeilBrown
2021-09-02  1:16             ` [PATCH 3/3 v3] NFSD: simplify struct nfsfh NeilBrown
2021-09-02  7:22             ` [PATCH 2/3 v3] NFSD: drop support for ancient filehandles Christoph Hellwig
2021-09-02  7:21           ` [PATCH 1/3 v3] NFSD: move filehandle format declarations out of "uapi" Christoph Hellwig
2021-09-23 21:21           ` Bruce Fields
2021-09-25  4:21             ` NeilBrown
  -- strict thread matches above, loose matches on Subject: below --
2021-07-27 22:37 [PATCH/RFC 00/11] expose btrfs subvols in mount table correctly NeilBrown
2021-08-13  1:45 ` [PATCH] VFS/BTRFS/NFSD: provide more unique inode number for btrfs export NeilBrown
2021-08-15  7:39   ` Goffredo Baroncelli
2021-08-15 19:35     ` Roman Mamedov
2021-08-15 22:17       ` NeilBrown
2021-08-23  4:05         ` [PATCH v2] BTRFS/NFSD: " NeilBrown
2021-08-23  8:17           ` kernel test robot
2021-08-23  8:17             ` kernel test robot

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='005d01d79bb3$7b914c10$72b3e430$@mindspring.com' \
    --to=ffilzlnx@mindspring.com \
    --cc=bfields@fieldses.org \
    --cc=chuck.lever@oracle.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    /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.