From: Trond Myklebust <trond.myklebust@primarydata.com>
To: Brown Neil <neilb@suse.de>
Cc: NFS <linux-nfs@vger.kernel.org>
Subject: Re: "nosharecache" option prevent "mount" from detecting when the mount is a duplicate.
Date: Mon, 10 Feb 2014 23:19:09 -0500 [thread overview]
Message-ID: <4A18E8CC-9376-4456-9FD6-E6B36BF8E89D@primarydata.com> (raw)
In-Reply-To: <20140211133013.1ccf8615@notabene.brown>
On Feb 10, 2014, at 21:30, NeilBrown <neilb@suse.de> wrote:
>
> (I seem to have quite a pile of NFS issues lately.... some if it is tidying up
> issues from before Christmas, some of it just keeps on coming :-)
>
> If you run "mount -a" it will attempt to mount all filesystems listed
> in /etc/fstab, but filesystems that are already mounted will not be mounted
> again. So it is normally safe to run "mount -a" multiple times.
>
> However if an NFS mount in /etc/fstab has the "nosharecache" option set,
> mount doesn't notice that it is already mounted as so mounts it again. So
> repeated "mount -a" is no longer safe.
>
> This happens because the prevention of multiple mounts happens in do_add_mount
> in fs/namespace.c:
>
> err = -EBUSY;
> if (path->mnt->mnt_sb == newmnt->mnt.mnt_sb &&
> path->mnt->mnt_root == path->dentry)
> goto unlock;
>
>
> i.e. if the exact same superblock is being mounted in the exact same place,
> return EBUSY.
> With nosharecache, every mount attempt produces a new superblock so this test
> never fires.
>
> One way to address this would be to have a different option, e.g.
> sharecache=27
>
> where the '27' is an arbitrary number meaning that if two mount attempts have
> different sharecache numbers they will have different superblocks. If they
> have the same sharecache number they can have the same superblock.
> This is not the most elegant interface ever and I would be very happy for
> suggestions to improve it. Maybe a string rather than a number ???
>
> This probably isn't a very serious issue, but is a regression in terms of the
> usability of "mount -a" and I think it would be best to fix it if the cost is
> not too high.
>
> Below is my patch to implement the "sharecache=%u" syntax.
>
> Any ideas?
What are people using nosharecache for these days, and why is this not another argument for just getting rid of it?
_________________________________
Trond Myklebust
Linux NFS client maintainer, PrimaryData
trond.myklebust@primarydata.com
next prev parent reply other threads:[~2014-02-11 4:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-11 2:30 "nosharecache" option prevent "mount" from detecting when the mount is a duplicate NeilBrown
2014-02-11 4:19 ` Trond Myklebust [this message]
2014-02-11 4:29 ` NeilBrown
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=4A18E8CC-9376-4456-9FD6-E6B36BF8E89D@primarydata.com \
--to=trond.myklebust@primarydata.com \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
/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