public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* /proc/mounts doesn't store bind flag
@ 2013-11-01 16:54 Phillip Susi
  2013-11-04 10:29 ` Karel Zak
  0 siblings, 1 reply; 4+ messages in thread
From: Phillip Susi @ 2013-11-01 16:54 UTC (permalink / raw)
  To: util-linux

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

When symlinking /etc/mtab to /proc/mounts, bind mounts no longer have
the bind option stored.  Is this a bug or working as intended?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSc9y2AAoJEJrBOlT6nu75ihwH/A/rKo6GYPN+fIS+eA271n2X
jqeGjHZr3mLfu5NGv+ihBWc9DM7zpxUXjWLzgY6+kyZ0RKyYbsbruQJLK3m+DPh5
+QASQ0p7ptKEArimKGeRMwqOlg0rRscZZRcPiT26ntwaS4aTreKtM2MvkJOdx2nR
XqQTFyWOlu6neo4cS1fZse+sFO6PcwnsyB1zclRVcQbSMS0e/8qS7SKZ9PO8KRzS
goT7gzvM/ShXmpOSblurFn3HFuVFswElDQ6WgWoNGHnJL9ClenBygUT7pMMj3Pbx
qyHJzCW67Tc4iBDBN3V6g3y3ZmyCzKvTe2BQop009KnPeutlv8yzEVYW0f7XST0=
=+HTn
-----END PGP SIGNATURE-----

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

* Re: /proc/mounts doesn't store bind flag
  2013-11-01 16:54 /proc/mounts doesn't store bind flag Phillip Susi
@ 2013-11-04 10:29 ` Karel Zak
  2013-11-04 14:02   ` Phillip Susi
  0 siblings, 1 reply; 4+ messages in thread
From: Karel Zak @ 2013-11-04 10:29 UTC (permalink / raw)
  To: Phillip Susi; +Cc: util-linux

On Fri, Nov 01, 2013 at 12:54:14PM -0400, Phillip Susi wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> When symlinking /etc/mtab to /proc/mounts, bind mounts no longer have
> the bind option stored.  Is this a bug or working as intended?

 This is expected thing. All utils that expect "bind" flag are broken.

 There is nothing like "bind" mountpoint (and kernel does not maintain
 such information at all), all mountpoints are equal, there is nothing
 like a primary (original) mountpoint. 
 
 You have to think about it as about hardlinks for files. The bind 
 operation creates just another path to the filesystem. That's all.

  mount /dev/sda1 /A
  mount --bind /A /B
  umount /A

 then /B is still valid (BTW, this is impossible to describe in
 the traditional /etc/mtab where was always relation between 
 /A and /B).

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

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

* Re: /proc/mounts doesn't store bind flag
  2013-11-04 10:29 ` Karel Zak
@ 2013-11-04 14:02   ` Phillip Susi
  2013-11-04 14:32     ` Karel Zak
  0 siblings, 1 reply; 4+ messages in thread
From: Phillip Susi @ 2013-11-04 14:02 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

That is pretty much what I thought, but why is the bind flag stored
when you do use mtab then?  Shouldn't they give the same behavior, so
bind should not be stored in mtab?  In particular it changes the way
you have to remount a bind mount ro, which is an unexpected user
visible change.

On 11/4/2013 5:29 AM, Karel Zak wrote:
> On Fri, Nov 01, 2013 at 12:54:14PM -0400, Phillip Susi wrote:
>> -----BEGIN PGP SIGNED MESSAGE----- When symlinking /etc/mtab to
>> /proc/mounts, bind mounts no longer have the bind option stored.
>> Is this a bug or working as intended?
> 
> This is expected thing. All utils that expect "bind" flag are
> broken.
> 
> There is nothing like "bind" mountpoint (and kernel does not
> maintain such information at all), all mountpoints are equal, there
> is nothing like a primary (original) mountpoint.
> 
> You have to think about it as about hardlinks for files. The bind 
> operation creates just another path to the filesystem. That's all.
> 
> mount /dev/sda1 /A mount --bind /A /B umount /A
> 
> then /B is still valid (BTW, this is impossible to describe in the
> traditional /etc/mtab where was always relation between /A and
> /B).
> 
> Karel
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSd6jsAAoJEJrBOlT6nu75zi8IALrs8Att9snO3z1Z1PcNikiG
yXuhaDLP8+4Nz8c8+GTFUc2SpaZHR6t1uUenMBiRrtlzqZFcGdQaNGF1wWorSTf9
cih7ffcgzXC7hA/pkPTCTTZYh1BJQbZqiH1coHoNlkyJo1ej6e0ZO42HEgQA+Aa3
0OKa6SkARTLY2NM7HBhxMpK42pt8G/3lZxngs3YHgVhB8UxeVylDcdH3M/z6GTPY
IdnjP/k1EzTgfhMXgd5OH/lvxmOhgt9kknSXz3D4sBUH24MJzKQ2N41+t1k/4K2u
LY8jb70kOxtlgmnlw+1fXk8lqi2vRxSUlupS8fLust6M4bUEzHlfLAOUaebTNYY=
=rHWj
-----END PGP SIGNATURE-----

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

* Re: /proc/mounts doesn't store bind flag
  2013-11-04 14:02   ` Phillip Susi
@ 2013-11-04 14:32     ` Karel Zak
  0 siblings, 0 replies; 4+ messages in thread
From: Karel Zak @ 2013-11-04 14:32 UTC (permalink / raw)
  To: Phillip Susi; +Cc: util-linux

On Mon, Nov 04, 2013 at 09:02:20AM -0500, Phillip Susi wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> That is pretty much what I thought, but why is the bind flag stored
> when you do use mtab then?  Shouldn't they give the same behavior, so

 Historical reasons... 10 years ago nobody cares about the 
 sense of the flag in the mtab ;-(
 
 And it's also difficult for userspace to generate the right mount
 source device if a directory is specified. 

 I'm not sure if I want to change the mtab behavior if for example
 old coreutils df(1) or some backup tools depend on this odd behavior. 
 
 It seems better to keep it without a change and provide a better
 solution only for new systems without mtab.

> bind should not be stored in mtab?  In particular it changes the way
> you have to remount a bind mount ro, which is an unexpected user
> visible change.

 Yes. The update to systems without mtab has some disadvantages, but
 it's still acceptable compare to mtab disadvantages.

 Fedora did the change years (2?) ago and the number of the bug
 reports related to this problem is almost zero. The question is what
 will happen on server (e.g. RHEL), we will see :-)

    Karel
 

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

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

end of thread, other threads:[~2013-11-04 14:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-01 16:54 /proc/mounts doesn't store bind flag Phillip Susi
2013-11-04 10:29 ` Karel Zak
2013-11-04 14:02   ` Phillip Susi
2013-11-04 14:32     ` Karel Zak

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