public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Adding subroot information to /proc/mounts, or obtaining that through other means
@ 2007-06-20 20:57 H. Peter Anvin
  2007-06-20 21:03 ` Al Viro
                   ` (2 more replies)
  0 siblings, 3 replies; 41+ messages in thread
From: H. Peter Anvin @ 2007-06-20 20:57 UTC (permalink / raw)
  To: Linux Kernel Mailing List, linux-fsdevel, util-linux-ng

Right now it is actually impossible to conclusively determine a
filesystem-relative path in the presence of bind (and possibly move)
mounts.  This is highly desirable to be able to do in contexts that
involve non-Linux (or not-the-current-instance-of-Linux) accesses to the
filesystem, e.g. other filesystems or bootloaders.

Example:

Let's assume /dev/md6 is mounted on /export.  Then /export/users/foo and
/exports/users/bar are bind-mounted to /home/foo and /home/bar respectively.

/proc/mounts will show:

/dev/md6 /export ext3 rw,data=ordered 0 0
/dev/md6 /home/foo ext3 rw,data=ordered 0 0
/dev/md6 /home/bar ext3 rw,data=ordered 0 0

... with no indication that anything is amiss.  The latter two fields
are confusing, at best.

We could add a field to /proc/mounts to add this information:

/dev/md6 /export ext3 rw,data=ordered 0 0 /
/dev/md6 /home/foo ext3 rw,data=ordered 0 0 /users/foo
/dev/md6 /home/bar ext3 rw,data=ordered 0 0 /users/bar

... or, alternatively, add a subfield to the first field (which would
entail escaping whatever separator we choose):

/dev/md6 /export ext3 rw,data=ordered 0 0
/dev/md6:/users/foo /home/foo ext3 rw,data=ordered 0 0
/dev/md6:/users/bar /home/bar ext3 rw,data=ordered 0 0

One could also consider providing a system call (or ioctl, ...) to get
this information, effectively as an augmentation to stat().  If that's
the case, it would probably be a good thing if this "stat-plus" system
call could in the future be expanded to contain additional information
without having to change a structure every time, perhaps using a method
similar to sendmsg/recvmsg, as ugly as those are.

I'm personally leaning toward the second option (/dev/md6:/users/foo).
Although that might confuse current utilities, those utilities are
*already* liable to get confused by the fact that the line doesn't mean
what they think it means.

	-hpa

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

end of thread, other threads:[~2007-07-16 18:50 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-20 20:57 Adding subroot information to /proc/mounts, or obtaining that through other means H. Peter Anvin
2007-06-20 21:03 ` Al Viro
2007-06-20 21:20   ` H. Peter Anvin
2007-06-21 16:20     ` Ram Pai
2007-06-21 16:29       ` H. Peter Anvin
2007-06-21 17:20         ` Ram Pai
2007-06-21 17:31       ` H. Peter Anvin
2007-06-21 17:43         ` H. Peter Anvin
2007-06-22  6:44         ` Ram Pai
2007-06-22  7:06           ` H. Peter Anvin
2007-06-22  7:34             ` Ram Pai
2007-06-22  7:51               ` H. Peter Anvin
     [not found]                 ` <20070625214640.GC29058@ram.us.ibm.com>
2007-06-25 22:00                   ` [RFC PATCH 1/1] VFS: Augment /proc/mount with subroot and shared-subtree Ram Pai
2007-06-26  8:01                     ` Karel Zak
2007-06-26 14:34                       ` H. Peter Anvin
2007-06-30  9:44                     ` Christoph Hellwig
2007-06-30 12:56                       ` H. Peter Anvin
2007-07-11 10:24                         ` Christoph Hellwig
2007-07-11 15:42                           ` Ram Pai
2007-07-16 18:46                   ` [RFC2 " Ram Pai
2007-06-20 22:24   ` Adding subroot information to /proc/mounts, or obtaining that through other means Karel Zak
2007-06-20 22:39     ` H. Peter Anvin
2007-06-20 22:33   ` Chuck Lever
2007-06-20 22:41     ` H. Peter Anvin
2007-06-20 22:48       ` Chuck Lever
2007-06-20 22:57         ` H. Peter Anvin
2007-06-20 23:02           ` Chuck Lever
2007-06-21 16:13   ` H. Peter Anvin
2007-06-21 16:49     ` Serge E. Hallyn
2007-06-21 16:51       ` H. Peter Anvin
2007-06-28 14:53   ` Pavel Machek
2007-06-28 15:36     ` H. Peter Anvin
2007-06-20 22:05 ` Karel Zak
2007-06-20 22:07   ` H. Peter Anvin
2007-06-20 22:41   ` Dr. David Alan Gilbert
2007-06-20 22:46     ` H. Peter Anvin
2007-06-21 19:14       ` Hans-Peter Jansen
2007-06-21 19:19         ` H. Peter Anvin
2007-06-20 22:55 ` Nix
2007-06-21 10:45   ` Miklos Szeredi
2007-06-21 19:42     ` Nix

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