All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J . Bruce Fields" <bfields@fieldses.org>
To: Jeff Layton <jlayton@kernel.org>
Cc: Amir Goldstein <amir73il@gmail.com>, Eryu Guan <eguan@redhat.com>,
	Miklos Szeredi <miklos@szeredi.hu>,
	fstests@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-unionfs@vger.kernel.org
Subject: Re: [PATCH 0/7] More NFS file handle unit tests
Date: Tue, 7 Nov 2017 14:54:51 -0500	[thread overview]
Message-ID: <20171107195451.GC24262@fieldses.org> (raw)
In-Reply-To: <1509837816.3820.4.camel@kernel.org>

On Sat, Nov 04, 2017 at 07:23:36PM -0400, Jeff Layton wrote:
> On Fri, 2017-11-03 at 08:22 -0400, Jeff Layton wrote:
> > On Thu, 2017-11-02 at 12:15 +0200, Amir Goldstein wrote:
> > > Eryu,
> > > 
> > > This series enhances test coverage for generic NFS file handles
> > > encode/decode functionality and adds a new gereric/exportfs test.
> > > 
> > > Please note that the new test output includes the temporary test
> > > number 500, so don't forget to fix those when renaming the test.
> > > 
> > > The enhanced open_by_handle program is going to be used later on for
> > > overlayfs specific exportfs tests [1].
> > > 
> > > The open_by_handle program is limited to encoding "non-connectable"
> > > file handles (used by nfsd on 'no_subtree_check' exports), because there
> > > is no user available API (that I know of) to encode a "connecctable" file
> > > handle (used by nfsd on 'subtree_check' exports). I used a test patch
> > > "test connectable file handles", available on my tree [1] to tun the tests
> > > with "connectable" file handles.
> > > 
> > > I verified that the new test passes on xfs, ext4, ext2, btrfs, f2fs.
> > > However, the test fails on tmpfs due to:
> > > "open_by_handle() returned 116 incorrectly on an unlinked open file!"
> > > 
> > > This happens because tmpfs uses d_find_alias() to get a decoded dentry,
> > > but d_find_alias() skips unhashed (deleted with refcount) dentries.
> > > 
> > > I don't know if being able to decode a file handle of a deleted but open
> > > file is a requirement for nfsd or just a recommendation, but IMO it is a
> > > common case that is worth testing, even if tmpfs (or other file systems)
> > > choose not to fix this.
> > > 
> > > Bruce, Jeff,
> > > 
> > > What is your view on this issue?
> > > 
> > > 
> > 
> > It seems like something that should be a requirement.
> > 
> > A client could (for instance) send a READ for a filehandle with one of
> > the special anonymous stateids. If you can't decode the filehandle, you
> > really have no way to know what inode against which to issue the read.

Also even if you use a "real" stateid the current implementation will
error out if the filehandle lookup fails, and that might be complicated
to fix.

> That said...
> 
> If an open file is unlinked, and the server reboots you're more or less
> back in the same situation anyway. That's generally the reason for
> sillyrenaming in NFSv4.x instead of just removing the files outright.
> 
> The main takeaway is that with NFS in general, it's actually rather
> difficult to ensure that behavior across all server failure scenarios.
> It'd be nice if tmpfs did this like the others, but it's probably not
> fatal if it doesn't.

I guess.  The idea of failing on an unlinked inode still makes me
nervous, though.  It's supposed to be a look up by *inode*, not dentry.
NFSv4 client can hold files open after unlink, even if the possibility
of server reboots means applications don't get a real guarantee of that.
tmpfs exports aren't much use across server reboots anyway, though.

Some day we may fix the reboot problem--but possibly just by doing
something like sillyrename on the server side, so that wouldn't affect
this case much.

I think some users would likely notice if we broke the ability to look
up an unlinked file so I'd rather we kept that test in.

--b.

  reply	other threads:[~2017-11-07 19:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-02 10:15 [PATCH 0/7] More NFS file handle unit tests Amir Goldstein
2017-11-02 10:15 ` [PATCH 1/7] open_by_handle: add filename to error reports Amir Goldstein
2017-11-02 10:15 ` [PATCH 2/7] open_by_handle: test file handles of renamed files Amir Goldstein
2017-11-08  4:10   ` Eryu Guan
2017-11-08  5:07     ` Eryu Guan
2017-11-08  6:11       ` Amir Goldstein
2017-11-02 10:15 ` [PATCH 3/7] open_by_handle: test content of open file handle Amir Goldstein
2017-11-02 10:15 ` [PATCH 4/7] open_by_handle: test directory " Amir Goldstein
2017-11-02 10:15 ` [PATCH 5/7] open_by_handle: test file handles of open files Amir Goldstein
2017-11-02 10:15 ` [PATCH 6/7] generic/426: factor out helper functions Amir Goldstein
2017-11-02 10:15 ` [PATCH 7/7] fstests: add test with more open by file handle use cases Amir Goldstein
2017-11-03 12:22 ` [PATCH 0/7] More NFS file handle unit tests Jeff Layton
2017-11-04 23:23   ` Jeff Layton
2017-11-07 19:54     ` J . Bruce Fields [this message]
2017-11-07 20:05 ` 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=20171107195451.GC24262@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=amir73il@gmail.com \
    --cc=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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.