All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: NFS <linux-nfs@vger.kernel.org>
Subject: Re: "nosharecache" option prevent "mount" from detecting when the mount is a duplicate.
Date: Tue, 11 Feb 2014 15:29:06 +1100	[thread overview]
Message-ID: <20140211152906.4b370ccb@notabene.brown> (raw)
In-Reply-To: <4A18E8CC-9376-4456-9FD6-E6B36BF8E89D@primarydata.com>

[-- Attachment #1: Type: text/plain, Size: 2790 bytes --]

On Mon, 10 Feb 2014 23:19:09 -0500 Trond Myklebust
<trond.myklebust@primarydata.com> wrote:

> 
> 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?

Baby or bath water?

In the particular case that brought this up for me they are actually using
"nosharetransport" which is a similar option I provide in SLES because there
are cases where sharing the transport reduces performance, and cases where
sharing the transport interacts poorly with particular details (of particular
versions) of the Netapp filer.

Seeing the root problem is the same for nosharecache and nosharetransport
it seems reasonable to report it upstream as an issue with nosharecache.

If you don't think this is worth "fixing", I certainly don't feel strongly
enough about it to argue.

Thanks,
NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

      reply	other threads:[~2014-02-11  4:29 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
2014-02-11  4:29   ` NeilBrown [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=20140211152906.4b370ccb@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.