[Pkg-sysvinit-devel] Bug#359717: Binding Mount to Itself Breaks Things

Elliott Mitchell ehem at m5p.com
Sat Apr 2 07:23:53 UTC 2011

Might I suggest pondering returning bug #359717 to wishlist severity and
taging it "wontfix"?

The problem is binding mounts *will* break things if used improperly (or
properly depending on POV and how sadistic you are). The steps used by
`mountpoint` are absolutely correct from Unix traditions, that /should/
detect a mount point.

Bind mounting a filesystem will break many programs that assume
traditional Unix behavior. By the standards, you're never supposed to see
a given device:inode pair recur multiple times, but binding mounts
violate this.

For an example, take a look at sysdeps/posix/getcwd.c from the libc6
source package, again, by the standards that code should be able to
successfully identify the current directory. Yet, if a filesystem is bind
mounted onto itself that code can be made to fail. getcwd() continues to
work only because Linux has a getcwd() system call, because getcwd() is
fairly expensive to implement in userspace and it is used by many

On one hand I'm of the opinion that bind mounts are the breakage here. On
the other hand one could call `mountpoint` a system utility, which should
deal with oddball conditions like this.

(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         EHeM at gremlin.m5p.com PGP F6B23DE0         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
2477\___\_|_/DC21 03A0 5D61 985B <-PGP-> F2BE 6526 ABD2 F6B2\_|_/___/3DE0

More information about the Pkg-sysvinit-devel mailing list