public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: bind-mount vs second mount of the same blockdev?
Date: Wed, 03 Nov 2010 12:39:57 +0300	[thread overview]
Message-ID: <4CD12DED.3010902@msgid.tls.msk.ru> (raw)

Hello.

I'm trying to understand the differences between
a bind-mount of a whole filesystem versus mounting
the same block device the second time.  Like this:

 mount -t ext3 /dev/block /mnt/a
 mount --bind /mnt/a /mnt/b

versus

 mount -t ext3 /dev/block /mnt/a
 mount -t ext3 /dev/block /mnt/b

In the second case, second mount does not happen
but the first one is "reused" instead - this is
visible in dmesg, since only once ext3fs prints
a note about the mounting.

Now, the first case is quite clear: we've one fs
visible in two places, pretty much like two hard-
links to the same file.  So things like, for
example, fcntl locking will work "from" both
ends.  But it is not that obvious in the second
case, even if we clearly have some common
"inode" in this case too.

What are the differences in behavour?

Thanks!

/mjt

             reply	other threads:[~2010-11-03  9:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-03  9:39 Michael Tokarev [this message]
2010-11-03 10:23 ` bind-mount vs second mount of the same blockdev? Al Viro

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=4CD12DED.3010902@msgid.tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox