linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@amacapital.net>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Linux FS Devel <linux-fsdevel@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>
Subject: Re: Removing shared subtrees?
Date: Mon, 29 Sep 2014 18:24:05 -0700	[thread overview]
Message-ID: <CALCETrXXFCfwEdi+AYELdr4umWPTr8=2x4AzvSTBX6E55Do2sw@mail.gmail.com> (raw)
In-Reply-To: <20140930011446.GQ7996@ZenIV.linux.org.uk>

On Mon, Sep 29, 2014 at 6:14 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> On Mon, Sep 29, 2014 at 05:36:27PM -0700, Andy Lutomirski wrote:
>
>> Ideally it would leave them around until the whole subtree had no
>> references, at which point /mnt and everything under it would
>> disappear with no side effects, because it has no references.
>
> So, assuming you've got a stuck NFS mount with a bunch of local stuff
> bound on top of it, in your ideal we'd have the latter all remaining
> mounted until the server comes back.  Lovely, that...

No, not at all.

>
>> I suspect it detaches them immediately, especially after reading the
>> rest of your email.
>
> IOW, you *still* have not bothered to say man umount and read the manpage?
>
> Quote:
>        -l     Lazy  unmount.  Detach  the filesystem from the filesystem
>               hierarchy now, and cleanup all references to the filesystem as
>               soon as it is not busy anymore.  (Requires kernel 2.4.11 or
>               later.)
>
>> > Such an elegant way to say "I can't be arsed to read"...  For what it's
>> > worth: MNT_DETACH is *not* "detach the subtree as whole, busy or not".
>> > It's "unmount all mounts within the subtree, busy or not".  At which point
>> > the self-LART you keep describing becomes quite easy to comprehend, doesn't
>> > it?

The manpage you quoted doesn't seem to agree with what you just said.
Or at least, it contains nothing that, to me, would indicate that.
But...

>>
>> Again, *I have no problem with the current semantics of umount -l*,
>> except insofar as they interact really nastily with shared subtrees.
>> I have a problem with bidirectional shared subtrees *in general*.
>
> Pardon me, but it really looks like your problem is with reading.  In general
> or not, but you are essentially complaining that your *guess* concerning the
> semantics of this and that doesn't match the reality all that well, and its
> combination with observed bits and pieces is really confusing.
>
> BTW, I certainly agree that documentation of the mount-related utils and
> syscalls could've been better.  But you clearly have never bothered to
> read the existing one.  I'm sorry, but "I've used this utility with that
> flag as root without ever checking what the manpage says about that
> flag; results are painful and incomprehensible; whaddya mean, read the
> fine manpage?" buys you very little sympathy.

Let me try this one more time:

I don't *care* whether MNT_DETACH unmounts submounts immediately or
when all the references are finally gone.  I didn't read the docs or
the code to see which is the case *because I don't care*.

I think it's somewhere between ridiculous and flat-out broken that
MNT_DETACH of the *root* of a shared subtree *propagates* the unmount
of submounts to the parent of the shared subtree.  This is IMO
completely bogus.

IOW, if I do:

mount --make-rshared /
mount --rbind / /mnt
umount -l /mnt/dev

then I fully expect /dev to be unmounted (although I think that this
is a misfeature).

But I did:

mount --make-rshared /
mount --rbind / /mnt
umount -l /mnt  <- the ROOT of the fscking shared subtree

And /dev got unmounted.  How does this make any sense at all?

I further claim that the entire concept of shared (as opposed to
slave) subtrees is essentially worthless and should possibly be
deprecated or removed outright.

--Andy

  reply	other threads:[~2014-09-30  1:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-29 23:45 Removing shared subtrees? Andy Lutomirski
2014-09-30  0:09 ` Al Viro
2014-09-30  0:14   ` Andy Lutomirski
2014-09-30  0:29     ` Al Viro
2014-09-30  0:36       ` Andy Lutomirski
2014-09-30  1:14         ` Al Viro
2014-09-30  1:24           ` Andy Lutomirski [this message]
2014-09-30  2:21             ` Al Viro
2014-09-30  2:40               ` Andy Lutomirski

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='CALCETrXXFCfwEdi+AYELdr4umWPTr8=2x4AzvSTBX6E55Do2sw@mail.gmail.com' \
    --to=luto@amacapital.net \
    --cc=ebiederm@xmission.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).