From: Jeff Layton <jlayton@redhat.com>
To: Stanislav Kinsbursky <skinsbursky@parallels.com>
Cc: "bfields@fieldses.org" <bfields@fieldses.org>,
"Myklebust, Trond" <Trond.Myklebust@netapp.com>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Grace period
Date: Tue, 10 Apr 2012 14:28:53 -0400 [thread overview]
Message-ID: <20120410142853.7e749ba2@corrin.poochiereds.net> (raw)
In-Reply-To: <4F84537A.40100@parallels.com>
On Tue, 10 Apr 2012 19:36:26 +0400
Stanislav Kinsbursky <skinsbursky@parallels.com> wrote:
> 10.04.2012 17:39, bfields@fieldses.org пишет:
> > On Tue, Apr 10, 2012 at 02:56:12PM +0400, Stanislav Kinsbursky wrote:
> >> 09.04.2012 22:11, bfields@fieldses.org пишет:
> >>> Since NFSv4 doesn't have a separate MOUNT protocol, clients need to be
> >>> able to do readdir's and lookups to get to exported filesystems. We
> >>> support this in the Linux server by exporting all the filesystems from
> >>> "/" on down that must be traversed to reach a given filesystem. These
> >>> exports are very restricted (e.g. only parents of exports are visible).
> >>>
> >>
> >> Ok, thanks for explanation.
> >> So, this pseudoroot looks like a part of NFS server internal
> >> implementation, but not a part of a standard. That's good.
> >>
> >>>> Why does it prevents implementing of check for "superblock-network
> >>>> namespace" pair on NFS server start and forbid (?) it in case of
> >>>> this pair is shared already in other namespace? I.e. maybe this
> >>>> pseudoroot can be an exclusion from this rule?
> >>>
> >>> That might work. It's read-only and consists only of directories, so
> >>> the grace period doesn't affect it.
> >>>
> >>
> >> I've just realized, that this per-sb grace period won't work.
> >> I.e., it's a valid situation, when two or more containers located on
> >> the same filesystem, but shares different parts of it. And there is
> >> not conflict here at all.
> >
> > Well, there may be some conflict in that a file could be hardlinked into
> > both subtrees, and that file could be locked from users of either
> > export.
> >
>
> Is this case handled if both links or visible in the same export?
> But anyway, this is not that bad. I.e it doesn't make things unpredictable.
> Probably, there are some more issues like this one (bind-mounting, for example).
> But I think, that it's root responsibility to handle such problems.
>
Well, it's a problem and one that you'll probably have to address to
some degree. In truth, the fact that you're exporting different
subtrees in different containers is immaterial since they're both on
the same fs and filehandles don't carry any info about the path in and
of themselves...
Suppose for instance that we have a hardlinked file that's available
from two different exports in two different containers. The grace
period ends in container #1, so that nfsd starts servicing normal lock
requests. An application takes a lock on that hardlinked file. In the
meantime, a client of container #2 attempts to reclaim the lock that he
previously held on that same inode and gets denied.
That's just one example. The scarier case is that the client of
container #1 takes the lock, alters the file and then drops it again
with the client of container #2 none the wiser. Now the file got
altered while client #2 thought he held a lock on it. That won't be fun
to track down...
This sort of thing is one of the reasons I've been saying that the
grace period is really a property of the underlying filesystem and not
of nfsd itself. Of course, we do have to come up with a way to handle
the grace period that doesn't involve altering every exportable fs.
--
Jeff Layton <jlayton@redhat.com>
next prev parent reply other threads:[~2012-04-10 18:28 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4F7F230A.6080506@parallels.com>
[not found] ` <20120406234039.GA20940@fieldses.org>
2012-04-09 11:24 ` Grace period Stanislav Kinsbursky
2012-04-09 13:47 ` Jeff Layton
2012-04-09 14:25 ` Stanislav Kinsbursky
2012-04-09 15:27 ` Jeff Layton
2012-04-09 16:08 ` Stanislav Kinsbursky
2012-04-09 16:11 ` bfields
2012-04-09 16:17 ` Myklebust, Trond
2012-04-09 16:21 ` bfields
2012-04-09 16:33 ` Myklebust, Trond
2012-04-09 16:39 ` bfields
2012-04-09 16:56 ` Stanislav Kinsbursky
2012-04-09 18:11 ` bfields
2012-04-10 10:56 ` Stanislav Kinsbursky
2012-04-10 13:39 ` bfields
2012-04-10 15:36 ` Stanislav Kinsbursky
2012-04-10 18:28 ` Jeff Layton [this message]
2012-04-10 20:46 ` bfields
2012-04-11 10:08 ` Stanislav Kinsbursky
2012-04-09 23:26 ` bfields
2012-04-10 11:29 ` Stanislav Kinsbursky
2012-04-10 13:37 ` bfields
2012-04-10 14:10 ` Stanislav Kinsbursky
2012-04-10 14:18 ` bfields
2016-06-14 21:25 [PATCH] NFS: Don't let readdirplus revalidate an inode that was marked as stale Trond Myklebust
2016-06-30 21:46 ` grace period Marc Eshel
2016-07-01 16:08 ` Bruce Fields
2016-07-01 17:31 ` Marc Eshel
2016-07-01 20:07 ` Bruce Fields
2016-07-01 20:24 ` Marc Eshel
2016-07-01 20:47 ` Bruce Fields
2016-07-01 20:46 ` Marc Eshel
2016-07-01 21:01 ` Bruce Fields
2016-07-01 22:42 ` Marc Eshel
2016-07-02 0:58 ` Bruce Fields
2016-07-03 5:30 ` Marc Eshel
2016-07-05 20:51 ` Bruce Fields
2016-07-05 23:05 ` Marc Eshel
2016-07-06 0:38 ` Bruce Fields
[not found] ` <OF5D486F02.62CECB7B-ON88257FE3.0071DBE5-88257FE3.00722318@LocalDomain>
2016-07-01 20:51 ` Marc Eshel
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=20120410142853.7e749ba2@corrin.poochiereds.net \
--to=jlayton@redhat.com \
--cc=Trond.Myklebust@netapp.com \
--cc=bfields@fieldses.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=skinsbursky@parallels.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).