Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1681237

Re: [PATCH] fs: ext4: inode->i_generation not assigned 0.

From "J. Bruce Fields" <bfields@fieldses.org>
Newsgroups linux.kernel
Subject Re: [PATCH] fs: ext4: inode->i_generation not assigned 0.
Date 2017-07-05 03:20 +0200
Message-ID <tZH90-7MS-5@gated-at.bofh.it> (permalink)
References (4 earlier) <tXILU-ia-25@gated-at.bofh.it> <tXLqp-21V-11@gated-at.bofh.it> <tXMw9-2FO-3@gated-at.bofh.it> <tXMPv-2Ms-5@gated-at.bofh.it> <tZnjY-30l-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Jul 03, 2017 at 09:04:46PM -0700, Darrick J. Wong wrote:
> On Thu, Jun 29, 2017 at 02:50:22PM -0400, J. Bruce Fields wrote:
> > On Thu, Jun 29, 2017 at 02:30:53PM -0400, J. Bruce Fields wrote:
> > > On Thu, Jun 29, 2017 at 10:25:28AM -0700, Darrick J. Wong wrote:
> > > > Was there ever a version of NFS (or more generally callers of the
> > > > exportfs code) that couldn't deal with i_generation in the file handle,
> > > > and therefore we invented this generation hack to work around the loss
> > > > of the generation information?
> > > > 
> > > > There's a comment in xfs_fs_encode_fh about not supporting 64bit inodes
> > > > with subtree_check (which seems to require one ino/gen pair for the file
> > > > and a second pair for the file's parent) on NFSv2 because v2 doesn't
> > > > provide enough space for all the file handle information, but that's the
> > > > furthest I got with lazy-mining the git history. :)
> > > 
> > > There's a comment in fs/ext4/super.c:ext4_nfs_get_inode
> > > 
> > > 	* Currently we don't know the generation for parent directory, so
> > > 	* a generation of 0 means "accept any"
> > > 
> > > But I don't see that used.
> > > 
> > > It was used once upon a time; I see it actually used in old 2.5 code in
> > > nfsd_get_dentry.  Hm.
> > 
> > Oh, maybe it's here in fs/libfs.c:generic_fh_to_parent:
> > 
> > 	switch (fh_type) {
> > 	case FILEID_INO32_GEN_PARENT:
> > 		inode = get_inode(sb, fid->i32.parent_ino,
> >         			  (fh_len > 3 ? fid->i32.parent_gen : 0));
> > 		break;
> > 	}
> > 
> > I'm not sure under what conditions that filehandle encoding is used.
> 
> The best guess I can come up with is the old nfs_fhbase_old style handles,
> which (afaict) do not carry parent i_generation?

Yeah, I just couldn't tell in the time I looked whether they could still
be handed out.

If not, then the only way they'd still be used is if a client had a
server continually mounted while the server was upgraded from a kernel
that still handed out the old filehandle.

So if they haven't been given out for long enough it's possible nobody
would notice if we dropped support.

But, I didn't get far enough to figure that out.

--b.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] fs: ext4: inode->i_generation not assigned 0. "Darrick J. Wong" <darrick.wong@oracle.com> - 2017-07-04 06:10 +0200
  Re: [PATCH] fs: ext4: inode->i_generation not assigned 0. "J. Bruce Fields" <bfields@fieldses.org> - 2017-07-05 03:20 +0200
    Re: [PATCH] fs: ext4: inode->i_generation not assigned 0. "Darrick J. Wong" <darrick.wong@oracle.com> - 2017-07-05 21:30 +0200
      Re: [PATCH] fs: ext4: inode->i_generation not assigned 0. Theodore Ts'o <tytso@mit.edu> - 2017-07-05 22:30 +0200
        Re: [PATCH] fs: ext4: inode->i_generation not assigned 0. Jeff Layton <jlayton@redhat.com> - 2017-07-07 13:00 +0200
          Re: [PATCH] fs: ext4: inode->i_generation not assigned 0. Theodore Ts'o <tytso@mit.edu> - 2017-07-07 18:00 +0200
            Re: [PATCH] fs: ext4: inode->i_generation not assigned 0. Jeff Layton <jlayton@redhat.com> - 2017-07-07 18:20 +0200
              Re: [PATCH] fs: ext4: inode->i_generation not assigned 0. "J. Bruce Fields" <bfields@fieldses.org> - 2017-07-07 18:50 +0200
      Re: [PATCH] fs: ext4: inode->i_generation not assigned 0. "J. Bruce Fields" <bfields@fieldses.org> - 2017-07-05 22:50 +0200
        Re: [PATCH] fs: ext4: inode->i_generation not assigned 0. NeilBrown <neilb@suse.com> - 2017-07-06 03:10 +0200
          Re: [PATCH] fs: ext4: inode->i_generation not assigned 0. "J. Bruce Fields" <bfields@fieldses.org> - 2017-07-06 04:50 +0200

csiph-web