From: Jeff Layton <jlayton@redhat.com>
To: Jeff Layton <jlayton@redhat.com>
Cc: "Myklebust, Trond" <Trond.Myklebust@netapp.com>,
Christopher T Vogan <cvogan@us.ibm.com>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
Steve Dickson <SteveD@redhat.com>,
Al Viro <viro@ZenIV.linux.org.uk>, NeilBrown <neilb@suse.de>
Subject: Re: NFSERR_STALE on umount with 3.10.0.RC5 kernel
Date: Fri, 28 Jun 2013 08:06:43 -0400 [thread overview]
Message-ID: <20130628080643.037bc080@corrin.poochiereds.net> (raw)
In-Reply-To: <20130627004159.7852c43c@tlielax.poochiereds.net>
On Thu, 27 Jun 2013 00:41:59 -0400
Jeff Layton <jlayton@redhat.com> wrote:
> On Thu, 27 Jun 2013 00:51:01 +0000
> "Myklebust, Trond" <Trond.Myklebust@netapp.com> wrote:
>
> > On Wed, 2013-06-26 at 15:24 -0600, Christopher T Vogan wrote:
> > > This is a complete network trace between the client and server.
> > >
> > >
> > > So this issue only happens on Kernels 3.9.6 and newer.
> > > I did not have this problem with Kernel 3.8.13
> > > nfs-utils-1.2.3-36 (from Redhat) was used w/ all kernel versions.
> >
> > Ah. I don't recall seeing that information before. In that case, I'm
> > guessing that the change in behaviour is likely to be commit
> > ecf3d1f1aa74da0d632b651a2e05a911f60e92c0 (vfs: kill FS_REVAL_DOT by
> > adding a d_weak_revalidate dentry op).
> >
> > Jeff, any comment on what behaviour you expect on umount()
> > post-ecf3d1f1aa?
> >
>
> (cc'ing Al and Neil in case they have thoughts on this too...)
>
> Well...not that :)
>
> It seems like we have a bit of a perfect storm here -- noac + this
> strange server behavior wrt to UMNT calls. I can reproduce the client
> behavior (UMNT before a GETATTR), but of course my servers don't start
> rejecting calls when you send them a UMNT request.
>
> First, I think I understand why you do *not* see this on earlier
> kernels. Those used d_revalidate to revalidate those dentries:
>
> -------------[snip]-------------
> if (!nfs_is_exclusive_create(dir, flags) && nfs_check_verifier(dir, dentry)) {
> if (nfs_lookup_verify_inode(inode, flags))
> goto out_zap_parent;
> goto out_valid;
> }
> -------------[snip]-------------
>
> So in this case, we're not doing an exclusive create and the verifier
> check returns true because IS_ROOT(dentry) is true.
> nfs_lookup_verify_inode returns false (none of the checks there pass),
> so we then treat this dentry as valid w/o doing any revalidation.
>
> The new nfs_weak_revalidate function doesn't treat IS_ROOT() dentries in
> any special way. I did a quick test patch that makes
> nfs_weak_revalidate return 1 if IS_ROOT(dentry) is true. That seems to
> fix the problem. I'm not sure if it makes sense to always skip
> revalidating IS_ROOT dentries like that though. It seems a bit
> heavy-handed...
>
> Like NeilB pointed out recently, umount() is a bit of a special case.
> We're not really interested in anything but the dentry here so not
> trying to revalidate the inode makes a lot of sense.
>
> I wonder if it might make more sense to declare a new LOOKUP_NOREVAL
> flag or something and have umount() syscalls set it in the lookup? Then
> we could look for that and simply return 1 if it's set. Or maybe have
> the VFS skip calling d_weak_revalidate (and maybe d_revalidate)
> altogether if it's set.
>
> On a related note, I think we ought to consider ripping out the UMNT
> code from the userland helper or maybe just retiring umount.nfs
> altogether. It's simply not possible for userland to handle that
> properly. The UMNT (if any) needs to be sent when we tear down the
> superblock, and only the kernel knows when that has happened.
>
So, looking again at this. I think the right long-term solution is to
do what Neil suggested in this thread from a few months ago:
"More fun with unmounting ESTALE directories."
Basically we ought to fix umount() to do its lookup without
revalidating the last step. We might also be able to get away without
revaliding any path components in the umount lookup, but that might be
more iffy if there are symlinks in the path...
In the near term, Christopher should be able to work around this
problem by simply getting rid of /sbin/umount.nfs. It'll mean that the
client doesn't send UMNT calls, but AIUI those are intended to be
advisory anyway.
--
Jeff Layton <jlayton@redhat.com>
next prev parent reply other threads:[~2013-06-28 12:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-18 13:47 NFSERR_STALE on umount with 3.10.0.RC5 kernel Christopher T Vogan
2013-06-18 15:09 ` Myklebust, Trond
2013-06-18 19:55 ` Christopher T Vogan
2013-06-18 19:59 ` Myklebust, Trond
2013-06-26 19:20 ` Steve Dickson
2013-06-26 19:25 ` Myklebust, Trond
2013-06-26 21:24 ` Christopher T Vogan
2013-06-27 0:51 ` Myklebust, Trond
2013-06-27 4:41 ` Jeff Layton
2013-06-28 12:06 ` Jeff Layton [this message]
2013-09-10 20:18 ` Christopher T Vogan
2013-06-27 19:25 ` Christopher T Vogan
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=20130628080643.037bc080@corrin.poochiereds.net \
--to=jlayton@redhat.com \
--cc=SteveD@redhat.com \
--cc=Trond.Myklebust@netapp.com \
--cc=cvogan@us.ibm.com \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=viro@ZenIV.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox