[parted-devel] [PATCH] unneeded stats...
Bryn M. Reeves
bmr at redhat.com
Mon Feb 23 17:01:03 UTC 2009
Karel Zak wrote:
>>>> # mount //dev/mapper/cyan /mnt
>>>> # grep cyan /proc/mounts
>>>> //dev/mapper/cyan /mnt ext3 rw,data=ordered 0 0
>>> I tested for this situation in my fedora10 environment With the latest
>>> parted. And if I do the mount with "//" /proc/mounts will show it with
>> Yep, just confirmed that on my f10 box so this has changed somewhere
>> between RHEL5's 2.6.18 (where I tested previously) and current upstream.
> The current mount(8) always canonicalize all paths, so it never call
What's the rational for that? I can see it confusing users who mount
e.g. via a symlink or other "non-canonical" device path (esp. with the
proliferation of disk/by-* symlinks; performing a reverse lookup on
these names is not entirely trivial).
> (RHEL5 != current:-)
> thing is kernel behaviour. You cannot rely on mount(8) -- there is
> more ways how to mount devices.
> I think the best way how to resolve this problem is to call stat(2)
> and ignore everything from /proc/mounts what is not S_IFBLK. It seems
> that paths are unreliable...
Agreed - see the start of the thread - Joel is trying to optimise out
unneeded stat(2) calls for names that "cannot" be file system paths. I
think in the cases he's already mentioned this is fine but for the
CIFS/SMBFS // style we really do have to go ahead and do the stat to
More information about the parted-devel