linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Joe Habermann <joe.habermann@gmail.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: incorrect EXDEV error occasionally returned for rename over NFS
Date: Wed, 24 Nov 2010 10:07:08 -0500	[thread overview]
Message-ID: <20101124150707.GA13737@fieldses.org> (raw)
In-Reply-To: <AANLkTimvvbDw+YYoK8ZuKt3fJHTjxrJgWhq7r9ucHjwo@mail.gmail.com>

On Tue, Nov 23, 2010 at 02:55:24PM -0600, Joe Habermann wrote:
> Sure, I'll take another look.  I definitely would prefer a more
> elegant solution.
> 
> With regard to the strcmp on ex_client->name(), I'm not sure that's 100% tight.
> Suppose we have an export such as:
>     *(rw,sync,no_subtree_check)
> And during the race window, that export is replaced with:
>     foo(rw,sync,no_subtree_check)
> And it's "foo" that's performing the rename.
> In this case, the export pointers will (generally) be different, as
> will the auth_domain pointers, as will the string pointed to by
> ex_client->name ("*" vs. "foo"), incorrectly leading to a failing
> check.

You're devious!  We need you reading more of the NFS code....

But I think we're both being stupid here: both exports are looked up
using the same auth_domain (rq_client), and it's really the filesystems
(or filesystem subtrees) that we want to compare anyway.

So just ditch the ex_client comparison and compare the two
(vfsmount,dentry) pairs.

(There may still be an odd race or two; e.g. if someone does

	mount --bind /export/path /export/path
	exportfs -f

between the two export lookups, could we end up with two different
vfsmounts that really could be treated as the same?  But I don't think
we need to support that.

Other alternatives would be to compare something like the fs-identifying
part of the filehandle, or the path. (Probably svc_export_match() should
be strcmp()'ing paths anyway--paths are what userspace deals in anyway,
so if we're ever in a situation where it makes a difference, and there
are two (mnt,dentry) pairs that alias to the same path, then we end up
with a cache request that userspace can never respond to.))

--b.

      reply	other threads:[~2010-11-24 15:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-15 21:46 incorrect EXDEV error occasionally returned for rename over NFS Joe Habermann
2010-11-16 18:55 ` J. Bruce Fields
2010-11-16 23:49   ` Joe Habermann
2010-11-17 23:39   ` Joe Habermann
2010-11-19 23:57     ` J. Bruce Fields
2010-11-23 20:55       ` Joe Habermann
2010-11-24 15:07         ` J. Bruce Fields [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=20101124150707.GA13737@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=joe.habermann@gmail.com \
    --cc=linux-nfs@vger.kernel.org \
    /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).