From: Jeff Layton <jlayton@redhat.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Ric Wheeler <rwheeler@redhat.com>,
Trond Myklebust <Trond.Myklebust@netapp.com>,
Anand Avati <avati@redhat.com>, Brian Foster <bfoster@redhat.com>,
Linux FS Devel <linux-fsdevel@vger.kernel.org>,
Alexander Viro <aviro@redhat.com>,
David Howells <dhowells@redhat.com>,
Eric Paris <eparis@redhat.com>,
Linux NFS list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] [REPOST] fuse: drop dentry on failed revalidate
Date: Fri, 2 Aug 2013 12:58:26 -0400 [thread overview]
Message-ID: <20130802125826.5cf53a4d@tlielax.poochiereds.net> (raw)
In-Reply-To: <CAJfpegthEZJEQhus=4CnvR+yb+vGj5c85kUnn18SrR0S1wbbtQ@mail.gmail.com>
On Fri, 2 Aug 2013 16:30:23 +0200
Miklos Szeredi <miklos@szeredi.hu> wrote:
> On Fri, Aug 2, 2013 at 1:43 PM, Jeff Layton <jlayton@redhat.com> wrote:
> > Ok, took me a couple of times to look over the code but I think I
> > understand the problem now...
> >
> > IIUC, then this patch should only ever cause this to return -ENOENT in
> > a situation similar to the one in Anand's reproducer, right? The
> > mountpoint-to-be was unlinked in another tree, and thus we found it to
> > be invalid in the tree that we're mounting in. If so, then the dentry
> > didn't exist at some point during the race window. Returning -ENOENT
> > seems reasonable to me in that situation.
>
> Yes, that's one part of it and ENOENT fits perfectly.
>
> The other part is when the subtree is moved on another host. Yes, NFS
> can reconnect it, but only if it is accessed through the new location.
> Until then it will be inaccessible and the new location of the
> mountpoint not discoverable through /proc/mounts or in any way without
> outside knowledge.
>
> And there was a pre-existing mount under the moved directory we don't
> allow the d_drop in this "move" case either, and the mount is
> accessible through the old name. I seem to recall that there was a
> discussion about this back then and Linus was quite adamant about
> mountpoints not being allowed to be dissolved or moved without an
> explicit action on the localhost (i.e. something that happens on
> remote hosts shouldn't affect the status or location of mounts on the
> localhost).
>
> So what happens in this case:
>
> host1: cd /nfs/foo/bar
> host2: mv /nfs/foo /nfs/old-foo
> host2: mkdir /nfs/foo
> host1: ls /nfs/foo [drops "old-foo" and adds a new foo dentry]
> host1: mkdir bin [cwd is now not accessible from root]
> host1: mount --bind /bin ./bin [???]
>
> Currently that last one succeeds, with my patch it gives ENOENT, but
> that's not the best error, since the mountpoint does exist.
>
Ok, good point...
That's a tricky situation. We're rejecting the mount there because we
can't _currently_ reach the mountpoint from root. It could become
reachable later though, at which point you could mount on there just
fine...
It almost sounds like it could use a new error code (EUNREACH?). Or,
maybe you could repurpose ENOLINK?
In any case, I'd be inclined not to worry about it and just go with
-ENOENT there. If someone complains we could consider a new error for
that case later.
--
Jeff Layton <jlayton@redhat.com>
prev parent reply other threads:[~2013-08-02 16:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20130725055209.GA15621@sh-el5.eng.rdu2.redhat.com>
[not found] ` <51F13948.3050100@redhat.com>
[not found] ` <CAJfpegtpcXz+i-3txRC_NjTsYjXP5S4oJUdGstG+-PWVzazEWQ@mail.gmail.com>
[not found] ` <51F81465.9010402@redhat.com>
[not found] ` <20130801163940.GA1356@tucsk.piliscsaba.szeredi.hu>
2013-08-01 18:45 ` [PATCH] [REPOST] fuse: drop dentry on failed revalidate Ric Wheeler
2013-08-02 9:02 ` Miklos Szeredi
2013-08-02 11:43 ` Jeff Layton
2013-08-02 14:30 ` Miklos Szeredi
2013-08-02 16:58 ` Jeff Layton [this message]
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=20130802125826.5cf53a4d@tlielax.poochiereds.net \
--to=jlayton@redhat.com \
--cc=Trond.Myklebust@netapp.com \
--cc=avati@redhat.com \
--cc=aviro@redhat.com \
--cc=bfoster@redhat.com \
--cc=dhowells@redhat.com \
--cc=eparis@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=rwheeler@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).