coreutils
[Top][All Lists]
Advanced

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

Re: df: do not filter remote filesystem


From: Fridolin Pokorny
Subject: Re: df: do not filter remote filesystem
Date: Wed, 20 Aug 2014 16:51:03 +0200
User-agent: KMail/4.13.3 (Linux/3.15.9-200.fc20.x86_64; KDE/4.13.3; x86_64; ; )

On Monday 18 August 2014 13:45:57 Bernhard Voelker wrote:
> On 08/13/2014 06:49 PM, Fridolin Pokorny wrote:
> > Hi,
> > 
> > I am proposing a simple patch to disable a remote filesystem filtering.
> > This issue was reported as a bug [1]. The filtering is based on device id
> > which seems to be confusing when using remote filesystems such as nfs.
> > 
> > Have a nice day!
> > Fridolin Pokorny
> > 
> > [1] https://bugzilla.redhat.com/show_bug.cgi?id=920806
> > 
> > diff --git a/src/df.c b/src/df.c
> > index 3ef5d33..26a0ad2 100644
> > --- a/src/df.c
> > +++ b/src/df.c
> > @@ -635,7 +635,7 @@ filter_mount_list (bool devices_only)
> > 
> >          {
> >          
> >            /* If we've already seen this device...  */
> >            for (devlist = device_list; devlist; devlist = devlist->next)
> > 
> > -            if (devlist->dev_num == buf.st_dev)
> > +            if (! me->me_remote && devlist->dev_num == buf.st_dev)
> > 
> >                break;
> >            
> >            if (devlist)
> 
> Thanks for the report, and especially the patch.
> 
> However, df(1) is about outputting statistics of file systems
> rather than mount points.  Therefore, it elides duplicate entries
> like bind mounts and such, and we put much effort in the code to get
> consistent behavior again in the v8.23 release.
> 
> Admittedly, the Texinfo manual only mentions bind mounts and pseudo
> file systems:
> 
>      For bind mounts and without arguments, `df' only outputs the
>   statistics for that device with the shortest mount point name in the
>   list of file systems (MTAB), i.e., it hides duplicate entries, unless
>   the `-a' option is specified.
> 
>      With the same logic, `df' elides a mount entry of a dummy pseudo
>   device if there is another mount entry of a real block device for that
>   mount point with the same device number, e.g. the early-boot pseudo
>   file system `rootfs' is not shown per default when already the real
>   root device has been mounted.
> 
> I.e., explicitly mentioning the elision of duplicate remote file
> systems like NFS exports would be worth.  Do you feel like sending
> a documentation patch for this?
> 
> Thanks & have a nice day,
> Berny

Thanks for the reply. Proposing requested patch.

Have a nice day,
Fridolin Pokorny

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 7c86719..03398fe 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -11171,7 +11171,8 @@ Non-integer quantities are rounded up to the next 
higher unit.
 For bind mounts and without arguments, @command{df} only outputs the statistics
 for that device with the shortest mount point name in the list of file systems
 (@var{mtab}), i.e., it hides duplicate entries, unless the @option{-a} option 
is
-specified.
+specified. Remote file systems, such as NFS, are treated the same way as local
+ones. Only one mount entry per remote file system is shown by default.
 
 With the same logic, @command{df} elides a mount entry of a dummy pseudo device
 if there is another mount entry of a real block device for that mount point 
with



reply via email to

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