[lkml]   [1998]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: mount(2) bug found
On Tue, Jun 16, 1998 at 09:21:26AM +0200, Rik van Riel wrote:
> It _is_ a bug. Just look at the following scenario:
> mirkwood:# df
> /dev/root / <blahblahblah>
> /dev/sda4 /stampede <blahblahblah>
> mirkwood:# chroot /stampede /bin/bash
> chroot:# mount /dev/sda1 /mnt
> chroot:# mount -t proc none /proc
> <flip to other console>
> mirkwood:# cat /proc/mounts
> /dev/root / <blah>
> /dev/sda4 /stampede <blah>
> none /proc <blah>
> /dev/sda1 /mnt <blah> <-- mounted on /stampede/mnt
> none /proc <blah> <-- mounted on /stampede/proc
> So you see, it _is_ a bug... This is mainly because
> programs like 'df' depend on the fact that the FSes
> are correctly listed.
> The above setup clearly breaks 'df' and other programs.

df uses (and should use) /etc/fstab and getmntent(3).

IMO /proc/mounts is not meant for lusers to twiddle with, but more for
admins. and system tools, as it can be kernel version dependant. Nor it it

If df uses /proc/mounts, IMO, _it_ is broken.

This all depends on what is considered to be the right smeantics for
/proc/mounts, and IMO, df doesn't come into the equation.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to

 \ /
  Last update: 2005-03-22 13:43    [W:0.073 / U:19.060 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site