bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#37702: Suggestion for 'df' utility


From: Bryce Harrington
Subject: bug#37702: Suggestion for 'df' utility
Date: Fri, 10 Jul 2020 16:29:21 -0700

On Mon, Jun 01, 2020 at 09:26:14AM -0700, Bryce Harrington wrote:
> On Mon, Jun 01, 2020 at 09:04:26AM -0700, Bryce Harrington wrote:
> > On Sun, May 31, 2020 at 01:49:24PM +0100, Pádraig Brady wrote:
> > > On 31/05/2020 10:36, Bernhard Voelker wrote:
> > > > What about to start with this?
> > > > 
> > > >    $ GIT_PAGER= git -C gnulib diff
> > > >    diff --git a/lib/mountlist.c b/lib/mountlist.c
> > > >    index 7abe0248e..5f6249dec 100644
> > > >    --- a/lib/mountlist.c
> > > >    +++ b/lib/mountlist.c
> > > >    @@ -164,6 +164,9 @@
> > > > 
> > > >     #define ME_DUMMY_0(Fs_name, Fs_type)            \
> > > >       (strcmp (Fs_type, "autofs") == 0              \
> > > >    +   || strcmp (Fs_type, "tmpfs") == 0            \
> > > 
> > > tmpfs is consumable, so wouldn't be appropriate to add I think
> > > 
> > > >    +   || strcmp (Fs_type, "devtmpfs") == 0         \
> > > >    +   || strcmp (Fs_type, "squashfs") == 0         \

FYI, I've landed your suggested change into Ubuntu's coreutils today.
Only difference from this is I interleaved these additions
alphabetically.

I'd still be interested in if there's a way to differentiate consumable
vs. non-consumable tmpfs mounts such that we can hide the latter.

> By the way, I'm told that the snap developers tag their squashfs mounts
> with "x-gdu.hide", so if we want to be more precise in what types of
> squashfs mount points to exclude filtering on that property might be
> one way.

I dug into this a bit more.  It looks like the tag is exposed through
libmount, however gnulib explicitly does not want to depend on
libmount.  If there is a different way to access this info on a mount
point that can be filtered on, it might be a helpful refinement.  I
don't know if there are many use cases for non-snap squashfs that would
need displayed in df output, but I imagine there must be some out there.

Bryce

>   $ mount | grep squashfs | head -n1
>   /var/lib/snapd/snaps/chromium_1143.snap on /snap/chromium/1143 type 
> squashfs (ro,nodev,relatime,x-gdu.hide)
> 
> 
> Bryce
> 
> > > >        || strcmp (Fs_type, "proc") == 0             \
> > > >        || strcmp (Fs_type, "subfs") == 0            \
> > > >        /* for Linux 2.6/3.x */                      \
> > 
> > This code appears to be part of gnulib, so I take it the patch would
> > need to be added there?  Would it also need updates to any tests, docs,
> > or other code?
> > 
> > You mentioned above this would need an option to override.  I checked
> > that `df -a` works as expected, but `df -t squashfs` just says:
> > 
> >   src/df: no file systems processed
> > 
> > It looks like -t only works from the filtered fs list, not on the
> > excluded dummy systems, so it's a consistent behavior.  However, I do
> > agree it could be nice for users to have a way to override the default
> > behavior; are you thinking a new option would be added?  If so can you
> > outline your thoughts on how that should work?
> > 
> > Thanks,
> > Bryce





reply via email to

[Prev in Thread] Current Thread [Next in Thread]