All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: William Koh <kkc6196@fb.com>, Andreas Dilger <adilger@dilger.ca>,
	"Theodore Ts'o" <tytso@mit.edu>,
	linux-ext4 <linux-ext4@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Kernel Team <Kernel-team@fb.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Trond Myklebust <trond.myklebust@primarydata.com>,
	xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] fs: ext4: inode->i_generation not assigned 0.
Date: Mon, 3 Jul 2017 21:04:46 -0700	[thread overview]
Message-ID: <20170704040446.GB4704@birch.djwong.org> (raw)
In-Reply-To: <20170629185022.GB4178@fieldses.org>

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?

--D

> 
> --b.

  reply	other threads:[~2017-07-04  4:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-28 22:06 [PATCH] fs: ext4: inode->i_generation not assigned 0 Kyungchan Koh
2017-06-29  0:48 ` Darrick J. Wong
2017-06-29  0:58   ` William Koh
2017-06-29  2:32 ` Andreas Dilger
2017-06-29  4:37   ` William Koh
2017-06-29  4:59     ` Darrick J. Wong
2017-06-29 14:28       ` William Koh
2017-06-29 14:35       ` J. Bruce Fields
2017-06-29 17:25         ` Darrick J. Wong
2017-06-29 18:30           ` J. Bruce Fields
2017-06-29 18:50             ` J. Bruce Fields
2017-07-04  4:04               ` Darrick J. Wong [this message]
2017-07-05  1:15                 ` J. Bruce Fields
2017-07-05 19:19                   ` Darrick J. Wong
2017-07-05 20:27                     ` Theodore Ts'o
2017-07-07 10:51                       ` Jeff Layton
2017-07-07 15:51                         ` Theodore Ts'o
2017-07-07 16:13                           ` Jeff Layton
2017-07-07 16:47                             ` J. Bruce Fields
2017-07-05 20:49                     ` J. Bruce Fields
2017-07-06  1:08                       ` NeilBrown
2017-07-06  2:39                         ` 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=20170704040446.GB4704@birch.djwong.org \
    --to=darrick.wong@oracle.com \
    --cc=Kernel-team@fb.com \
    --cc=adilger@dilger.ca \
    --cc=bfields@fieldses.org \
    --cc=kkc6196@fb.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.com \
    --cc=tytso@mit.edu \
    /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.