Bug 1798030
| Summary: | df --local should exclude AFS , SMB3 and GPFS filesystems. | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Kenneth D'souza <kdsouza> |
| Component: | coreutils | Assignee: | Kamil Dudka <kdudka> |
| Status: | CLOSED ERRATA | QA Contact: | Radka Brychtova <rskvaril> |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 8.4 | CC: | jaltman, jshivers, karlamrhein, kdudka |
| Target Milestone: | rc | Keywords: | Reproducer |
| Target Release: | 8.0 | Flags: | pm-rhel:
mirror+
|
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | coreutils-8.30-8.el8 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-11-04 01:37:10 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: | |||
(In reply to Kenneth D'souza from comment #0) > Version-Release number of selected component (if applicable): > All: Please always tell us the exact build (e.g. coreutils-8.22-24.el7) you tested it with. Even if all versions were affected now, it might not be true when someone tries to reproduce the bug few years later. > Actual results: > > # df -l | less > /dev/sda2 588352 276600 268744 > 51% /boot > remote-staas-fs1 1333217886208 764695533568 568522352640 > 58% /gpfs/slac/staas/fs1 Could you please paste the output of df --print-type ...? > We can always add more filesystems to the above code but I am not sure if > that's a good idea. As there are many remote/shared filesystem out there > adding each filesystem to the above code would not be fruitful. Yes, it sounds like we should add more patterns to this logic. Note that AFS should now be supported by `stat` and `tail` since bug #1659530 is fixed. # rpm -q coreutils coreutils-8.30-6.el8.x86_64 # df --print-type your-file-system.com:root.cell afs 6813657088 254 6813656834 1% /afs/your-file-system.com your-file-system.com:amd64_linux26 afs 20971520 6 20971514 1% /afs/your-file-system.com/amd64_linux26 The AFS patch has been posted upstream. https://lists.gnu.org/archive/html/bug-gnulib/2020-02/txttTmHgwFcxo.txt From 5f47c372cd94867ce8a303e5ddba38b7e4bc6d8b Mon Sep 17 00:00:00 2001 From: Marc Dionne <address@hidden> Date: Tue, 4 Feb 2020 11:40:05 -0400 Subject: [PATCH] mountlist: Consider AFS filesystems as remote df --local relies on the ME_REMOTE macro to determine if a given mount entry should be considered "local". There is special logic for nfs and smb/cifs mounts, but /afs as mounted by OpenAFS, the kernel's kafs module or AuriStorFS is treated as a local mount. Add some logic to treat mounts of type 'afs' (OpenAFS, kernel kafs) and 'auristorfs' (AuriStorFS) as remote. Signed-off-by: Marc Dionne <address@hidden> --- lib/mountlist.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/mountlist.c b/lib/mountlist.c index 61063ce91..255e350e0 100644 --- a/lib/mountlist.c +++ b/lib/mountlist.c @@ -221,6 +221,7 @@ me_remote (char const *fs_name, char const *fs_type _GL_UNUSED) #ifndef ME_REMOTE /* A file system is "remote" if its Fs_name contains a ':' or if (it is of type (smbfs or cifs) and its Fs_name starts with '//') + or if it is of type (afs or auristorfs) or Fs_name is equal to "-hosts" (used by autofs to mount remote fs). */ # define ME_REMOTE(Fs_name, Fs_type) \ (strchr (Fs_name, ':') != NULL \ @@ -228,6 +229,8 @@ me_remote (char const *fs_name, char const *fs_type _GL_UNUSED) && (Fs_name)[1] == '/' \ && (strcmp (Fs_type, "smbfs") == 0 \ || strcmp (Fs_type, "cifs") == 0)) \ + || strcmp (Fs_type, "afs") == 0 \ + || strcmp (Fs_type, "auristorfs") == 0 \ || (strcmp("-hosts", Fs_name) == 0)) #endif (In reply to Kenneth D'souza from comment #3) > The AFS patch has been posted upstream. > > https://lists.gnu.org/archive/html/bug-gnulib/2020-02/txttTmHgwFcxo.txt Excellent. Once it is merged upstream, we can pick it from there. (In reply to Kamil Dudka from comment #5) > Excellent. Once it is merged upstream, we can pick it from there. Upstream commit (does not include smb3): https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=7a15069b (In reply to Kamil Dudka from comment #8) > (In reply to Kamil Dudka from comment #5) > > Excellent. Once it is merged upstream, we can pick it from there. > > Upstream commit (does not include smb3): > > https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=7a15069b Yes, as of now only afs patch has been picked. The smb3 patch is yet to be reviewed. (In reply to Kamil Dudka from comment #8) > Upstream commit (does not include smb3): > > https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=7a15069b Upstream commit for smb3: https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=4d4a22ab Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (coreutils bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:4454 |
Description of problem: Currently df -l would only exclude a limited set of filesystems(nfs,cifs,smbfs and autofs with --hosts) which are hard coded. Hence other filesystems would still be listed when df -l is run even though they are shared or remote filesystems. Version-Release number of selected component (if applicable): All: How reproducible: Always: Steps to Reproduce: 1. Create an AFS or GPFS filesystem and mount it 2. Run df -l Actual results: # df -l | less /dev/sda2 588352 276600 268744 51% /boot remote-staas-fs1 1333217886208 764695533568 568522352640 58% /gpfs/slac/staas/fs1 Expected results: # df -l | less /dev/sda2 588352 276600 268744 51% /boot Only local filesystems should be listed. Additional info: Currently the filesystems are hard coded and in lib/mountlist.c: From upstream gnulib source code: # less lib/mountlist.c #ifndef ME_REMOTE /* A file system is "remote" if its Fs_name contains a ':' or if (it is of type (smbfs or cifs) and its Fs_name starts with '//') or Fs_name is equal to "-hosts" (used by autofs to mount remote fs). */ # define ME_REMOTE(Fs_name, Fs_type) \ (strchr (Fs_name, ':') != NULL \ || ((Fs_name)[0] == '/' \ && (Fs_name)[1] == '/' \ && (strcmp (Fs_type, "smbfs") == 0 \ || strcmp (Fs_type, "cifs") == 0)) \ || (strcmp("-hosts", Fs_name) == 0)) #endif We can always add more filesystems to the above code but I am not sure if that's a good idea. As there are many remote/shared filesystem out there adding each filesystem to the above code would not be fruitful.