[Toybox] [PATCH] df: -a should even show mounts we couldn't stat.

Yi-yo Chiang yochiang at google.com
Sun Feb 14 11:32:35 PST 2021


Hi Rob,

I think the main purpose of the original patch is to show mounts whose
stat()/statvfs() failed.
For example, an under-privileged user may be able to read /proc/mounts but
lack the permission to stat(vfs) the mount point, so showing "-" is a way
of saying "I know this XXX device is being mount on YYY mount point,
however for whatever reason I lack the means to get usage information from
the filesystem".

So I think 5f5f97f215bb accomplishes what the original change wants by not
skipping 0:0 device at all and gives "st_dev == 0" a special meaning of
"stat(mount point) failed".
The only question I have left, is it guaranteed that st_dev must be zero or
left unchanged when stat() fails? Or do we need to do something like, "if
stat() / statvfs() fails, ensure st_dev is zero" in portability.c to ensure
the caller knows that stat(mount point) failed?


On Mon, Feb 15, 2021 at 3:02 AM Rob Landley <rob at landley.net> wrote:

> On 2/14/21 6:17 AM, Rob Landley wrote:
> > On 2/13/21 5:45 PM, Rob Landley wrote:
> > Part of what's confusing me here is you're still skipping device 0:0,
> which is a
> > "should never happen" entry? (Even ramfs is only major 0 with minor
> incrementing
> > per-mount I think?)
> >
> > Can we just change to print the - - - - entries for a device 0 0 and not
> have to
> > change the lib plumbing for the extra flag? Or am I missing something?
>
> Tell me if commit 5f5f97f215bb implements what you want?
>
> Rob
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net
>


-- 

Yi-yo Chiang
Software Engineer
yochiang at google.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20210215/3d2849e4/attachment.html>


More information about the Toybox mailing list