public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* bind-mount vs second mount of the same blockdev?
@ 2010-11-03  9:39 Michael Tokarev
  2010-11-03 10:23 ` Al Viro
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Tokarev @ 2010-11-03  9:39 UTC (permalink / raw)
  To: Kernel Mailing List

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: bind-mount vs second mount of the same blockdev?
  2010-11-03  9:39 bind-mount vs second mount of the same blockdev? Michael Tokarev
@ 2010-11-03 10:23 ` Al Viro
  0 siblings, 0 replies; 2+ messages in thread
From: Al Viro @ 2010-11-03 10:23 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: Kernel Mailing List

On Wed, Nov 03, 2010 at 12:39:57PM +0300, Michael Tokarev wrote:
>  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

[snip]

> What are the differences in behavour?

None.  Both lead to the identical states.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-11-03 10:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-03  9:39 bind-mount vs second mount of the same blockdev? Michael Tokarev
2010-11-03 10:23 ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox