All of lore.kernel.org
 help / color / mirror / Atom feed
From: Isaac Dunham <ibid.ag@gmail.com>
To: james harvey <jamespharvey20@gmail.com>
Cc: util-linux@vger.kernel.org
Subject: Re: Expected behavior of "mount /mnt/root /mnt/root --bind"
Date: Fri, 28 Aug 2015 20:58:11 -0700	[thread overview]
Message-ID: <20150829035810.GB1616@localhost> (raw)
In-Reply-To: <CA+X5Wn45VNhXYztEVxrccF6uePshfFv3X3isB39y5RYT1-uUAg@mail.gmail.com>

On Sat, Aug 29, 2015 at 03:32:30AM +0000, james harvey wrote:
> If /dev/vda is a btrfs volume (not using partitioning) and is mounted to /mnt
> 
> And if /mnt/root is made as a normal directory (not a subdirectory)
> 
> And if an nfs share is mounted to /mnt/root/mnt
> 
> And for some reason "mount /mnt/root /mnt/root --bind" is ran
> 
> ... Should /mnt/root/mnt now be viewable as an empty mountpoint,
> hiding the nfs share?

Yes, since you used --bind not --rbind.

> Right now it does that.  Not sure what the expected behavior would be.
> Not sure if "mount x x" is ever desired to be allowed, or if it should
> refuse to do that.

It's a documented and used feature that you can bind mount a directory
over itself.

HTH,
Isaac Dunham

      reply	other threads:[~2015-08-29  3:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-29  3:32 Expected behavior of "mount /mnt/root /mnt/root --bind" james harvey
2015-08-29  3:58 ` Isaac Dunham [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=20150829035810.GB1616@localhost \
    --to=ibid.ag@gmail.com \
    --cc=jamespharvey20@gmail.com \
    --cc=util-linux@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 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.