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

2021-02-18 Thread Yi-yo Chiang via Toybox
> it's not clear to me whether yi-yo is happy yet? Finally got some time to thoroughly test the *enhanced* df! I'm pretty happy with the output now, where `df ` shows more accurate results than that of coreutils for over-mounted filesystems, and `df -a` shows all mounts no matter what (best effort

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

2021-02-17 Thread Rob Landley
On 2/17/21 1:40 PM, enh wrote: > > > On Wed, Feb 17, 2021 at 10:54 AM Rob Landley > wrote: > > On 2/16/21 3:24 PM, enh wrote: > >     There's a problem where if we can't stat it, we can't tell which one > it is out > >     of /proc/mounts because we can'

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

2021-02-17 Thread Rob Landley
On 2/16/21 2:52 PM, Yi-yo Chiang wrote: > There is still one weird case left in df, albeit not related to previous > issues,  > $ adb shell df > Filesystem                    1K-blocks    Used Available Use% Mounted on > /dev/block/dm-1                  964296  961376      2920 100% / > tmpfs    

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

2021-02-17 Thread enh via Toybox
On Wed, Feb 17, 2021 at 10:54 AM Rob Landley wrote: > On 2/16/21 3:24 PM, enh wrote: > > There's a problem where if we can't stat it, we can't tell which one > it is out > > of /proc/mounts because we can't match the device. And you can't do > an exact > > match on the filename becaus

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

2021-02-17 Thread Rob Landley
On 2/16/21 3:24 PM, enh wrote: > There's a problem where if we can't stat it, we can't tell which one it > is out > of /proc/mounts because we can't match the device. And you can't do an > exact > match on the filename because "df ." is a directory under the mount > point. I > wo

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

2021-02-17 Thread Rob Landley
On 2/16/21 3:05 PM, enh wrote: > P.S. lanana.org is still there but if you click on the > "linux device list" from > their main page it's 404. Gotta pull it out of archive.org... > > > (i genuinely hadn't realized LANANA was a real thing; i thought it was another >

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

2021-02-16 Thread enh via Toybox
On Tue, Feb 16, 2021 at 8:36 AM Rob Landley wrote: > On 2/16/21 3:01 AM, Yi-yo Chiang wrote:> > I think the main purpose of > the > original patch is to show mounts whose > > > stat()/statvfs() failed. > > > > And the current one should do that? (I don't have any mount points I > can'

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

2021-02-16 Thread enh via Toybox
On Mon, Feb 15, 2021 at 6:31 AM Rob Landley wrote: > Sigh, thunderbird crashed and I lost 8 gazillion open reply windows with > half-composed messages. (Kmail used to remember messages being composed > and open > them back up again when it was relaunched. I miss kmail, but they tied it > to a > b

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

2021-02-16 Thread enh via Toybox
On Sun, Feb 14, 2021 at 4:04 AM Rob Landley wrote: > On 2/13/21 5:45 PM, Rob Landley wrote: > > On 2/12/21 7:37 PM, enh via Toybox wrote:>> Also switch to FLAG() and > capitalize POSIX. > > > > I'm tempted to break that part out and apply it just so I can see what > the rest > > of the changes ar

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

2021-02-16 Thread enh via Toybox
On Sat, Feb 13, 2021 at 3:32 PM Rob Landley wrote: > On 2/12/21 7:37 PM, enh via Toybox wrote: > > In xgetmountlist(), keep track of whether we could stat or not, so we > > can distinguish an actual device 0:0 from a failed stat/statvfs. > > Is there an actual device 0:0? > (i was just preservin

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

2021-02-16 Thread Yi-yo Chiang via Toybox
There is still one weird case left in df, albeit not related to previous issues, $ adb shell df Filesystem1K-blocksUsed Available Use% Mounted on /dev/block/dm-1 964296 961376 2920 100% / tmpfs 20046361060 2003576 1% /

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

2021-02-16 Thread Yi-yo Chiang via Toybox
On Wed, Feb 17, 2021 at 12:36 AM Rob Landley wrote: > On 2/16/21 3:01 AM, Yi-yo Chiang wrote:> > I think the main purpose of > the > original patch is to show mounts whose > > > stat()/statvfs() failed. > > > > And the current one should do that? (I don't have any mount points I > can

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

2021-02-16 Thread Rob Landley
On 2/16/21 3:01 AM, Yi-yo Chiang wrote:> > I think the main purpose of the original patch is to show mounts whose > > stat()/statvfs() failed. > > And the current one should do that? (I don't have any mount points I > can't stat > because my laptop doesn't do crazy things with lin

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

2021-02-16 Thread Yi-yo Chiang via Toybox
On Mon, Feb 15, 2021 at 10:31 PM Rob Landley wrote: > Sigh, thunderbird crashed and I lost 8 gazillion open reply windows with > half-composed messages. (Kmail used to remember messages being composed > and open > them back up again when it was relaunched. I miss kmail, but they tied it > to a >

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

2021-02-15 Thread Rob Landley
Sigh, thunderbird crashed and I lost 8 gazillion open reply windows with half-composed messages. (Kmail used to remember messages being composed and open them back up again when it was relaunched. I miss kmail, but they tied it to a boat anchor of a desktop...) Oh well, makes closing down my lapto

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

2021-02-14 Thread Yi-yo Chiang via Toybox
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 mo

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

2021-02-14 Thread Rob Landley
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 t

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

2021-02-14 Thread Rob Landley
On 2/13/21 5:45 PM, Rob Landley wrote: > On 2/12/21 7:37 PM, enh via Toybox wrote:>> Also switch to FLAG() and > capitalize POSIX. > > I'm tempted to break that part out and apply it just so I can see what the > rest > of the changes are more clearly. > > You want to print unstat-able devices w

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

2021-02-13 Thread Rob Landley
On 2/12/21 7:37 PM, enh via Toybox wrote: > In xgetmountlist(), keep track of whether we could stat or not, so we > can distinguish an actual device 0:0 from a failed stat/statvfs. Is there an actual device 0:0? > Also switch to FLAG() and capitalize POSIX. I'm tempted to break that part out and

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

2021-02-12 Thread Yi-yo Chiang via Toybox
Not related to your change, but I noticed we're using "statvfs.f_bsize" as filesystem block size to calculate the used percentage. We should use "statvfs.f_frsize" instead as that is the unit of "statvfs.f_blocks". On Sat, Feb 13, 2021 at 9:37 AM enh via Toybox wrote: > In xgetmountlist(), keep

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

2021-02-12 Thread enh via Toybox
In xgetmountlist(), keep track of whether we could stat or not, so we can distinguish an actual device 0:0 from a failed stat/statvfs. Also switch to FLAG() and capitalize POSIX. --- lib/lib.h | 1 + lib/portability.c | 12 --- toys/posix/df.c | 55 -