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: Bernhard Voelker
Subject: Re: df: do not filter remote filesystem
Date: Mon, 18 Aug 2014 13:45:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

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



reply via email to

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