]> git.ipfire.org Git - thirdparty/coreutils.git/commit
df: fix duplicated remote entries due to bind mounts
authorKamil Dudka <kdudka@redhat.com>
Wed, 30 Jun 2021 15:53:22 +0000 (17:53 +0200)
committerPádraig Brady <P@draigBrady.com>
Fri, 2 Jul 2021 16:32:46 +0000 (17:32 +0100)
commitd6125af095c9553f38cba0696f15158f5abe4ecc
tree85944b0c317f36afd21c2606eca59f647f425bd6
parentda0d448bca62c6305fc432f67e2c5ccc2da75346
df: fix duplicated remote entries due to bind mounts

As originally reported in <https://bugzilla.redhat.com/1962515>,
df invoked without -a printed duplicated entries for NFS mounts
of bind mounts.  This is a regression from commit v8.25-54-g1c17f61ef99,
which introduced the use of a hash table.

The proposed patch makes sure that the devlist entry seen the last time
is used for comparison when eliminating duplicated mount entries.  This
way it worked before introducing the hash table.

Patch co-authored by Roberto Bergantinos.

* src/ls.c (struct devlist): Introduce the seen_last pointer.
(devlist_for_dev): Return the devlist entry seen the last time if found.
(filter_mount_list): Remember the devlist entry seen the last time for
each hashed item.
* NEWS: Mention the bug fix.
Fixes https://bugs.gnu.org/49298
NEWS
src/df.c