Bug 2177263

Summary: df: duplicates listed bind mounts for remote filesystems (NFS) with same fsid/device without "-a", even with BZ 1962515 fixed.
Product: Red Hat Enterprise Linux 8 Reporter: Ayan Neogi <aneogi>
Component: coreutilsAssignee: Lukáš Zaoral <lzaoral>
Status: CLOSED MIGRATED QA Contact: Radka Brychtova <rskvaril>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.7CC: kdudka
Target Milestone: rcKeywords: MigratedToJIRA
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-20 19:33:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ayan Neogi 2023-03-10 16:10:14 UTC
Description of problem:

I get duplicates on this reproducer even with BZ 1962515 fixed,
i.e. without -a, duplicates are listed for remote FS/s under 
same device (same exported fsid), when it is bind mounted, test case for NFS:

## RHEL8:

$ uname -r
4.18.0-425.13.1.el8_7.x86_64

$ rpm -q coreutils
coreutils-8.30-13.el8.x86_64

$ mkdir -p /original /bind1 /bind2

$ mount.nfs server:/nfs /original -v     
mount.nfs: timeout set for Fri Mar 10 10:50:59 2023
mount.nfs: trying text-based options 'vers=4.2,addr=192.168.122.40,clientaddr=192.168.122.121'

$ mount --bind /original/testd1 /bind1 -v
mount: /original/testd1 bound on /bind1.

$ mount --bind /original/testd2 /bind2 -v
mount: /original/testd2 bound on /bind2.

$ df -ht nfs4                            
Filesystem          Size  Used Avail Use% Mounted on
server:/nfs          97M  5.4M   92M   6% /original
server:/nfs/testd1   97M  5.4M   92M   6% /bind1   
server:/nfs/testd2   97M  5.4M   92M   6% /bind2   

$ mount --bind /original/testd1 /bind1 -v
mount: /original/testd1 bound on /bind1.

$ mount --bind /original/testd2 /bind2 -v
mount: /original/testd2 bound on /bind2.

$ df -ht nfs4
Filesystem          Size  Used Avail Use% Mounted on
server:/nfs          97M  5.4M   92M   6% /original
server:/nfs/testd1   97M  5.4M   92M   6% /bind1   
server:/nfs/testd2   97M  5.4M   92M   6% /bind2   
server:/nfs/testd1   97M  5.4M   92M   6% /bind1   <--- dup
server:/nfs/testd2   97M  5.4M   92M   6% /bind2   <--- dup

$ cat /proc/fs/nfsfs/volumes 
NV SERVER   PORT DEV          FSID                              FSC
v4 c0a87a28  801 0:55         8d133867f8e04cf9:984d43c5f2b82b17 no 

$ grep 0:55 /proc/self/mountinfo
423 97 0:55 / /original rw,relatime shared:219 - nfs4 ...
421 97 0:55 / /bind1 rw,relatime shared:219 - nfs4 ...
439 97 0:55 / /bind2 rw,relatime shared:219 - nfs4 ...
449 421 0:55 / /bind1 rw,relatime shared:219 - nfs4 ...
459 423 0:55 / /original/testd1 rw,relatime shared:219 - nfs4 ...
502 439 0:55 / /bind2 rw,relatime shared:219 - nfs4 ...
503 423 0:55 / /original/testd2 rw,relatime shared:219 - nfs4 ...


Version-Release number of selected component (if applicable): 8.7, coreutils-8.30-13.el8.x86_64


How reproducible: 100%


Steps to Reproduce: see above
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Kamil Dudka 2023-03-21 16:44:12 UTC
Thank you for reporting it!  I am able to reproduce the described behavior.  I do not think it is the same issue that bug #1962515 was supposed to fix though.  Bug #1962515 was fixing a regression introduced by the following upstream commit:

    https://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.25-54-g1c17f61ef99

... whereas the behavior described in this bug seems to be consistent from RHEL-7 through Fedora.

Comment 2 RHEL Program Management 2023-09-20 19:31:56 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 3 RHEL Program Management 2023-09-20 19:33:38 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.