Blame SOURCES/coreutils-8.22-df-stat.patch

c2acb1
From 9c4641f42bbecf63ec0a0e05caacbccd5332b831 Mon Sep 17 00:00:00 2001
c2acb1
From: Philipp Thomas <pth@suse.de>
c2acb1
Date: Sun, 26 Mar 2017 22:34:00 -0700
c2acb1
Subject: [PATCH 1/2] df: avoid querying excluded file systems
c2acb1
c2acb1
* src/df.c (filter_mount_list): Avoid stat() on
c2acb1
explicitly excluded file systems, which is especially
c2acb1
significant in cases like `-x nfs` which may hang.
c2acb1
* NEWS: Mention the bug fix.
c2acb1
c2acb1
Upstream-commit: 7c228bc55ed3fd6d56a6ad135438066de2f54a30
c2acb1
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
c2acb1
---
c2acb1
 src/df.c | 4 +++-
c2acb1
 1 file changed, 3 insertions(+), 1 deletion(-)
c2acb1
c2acb1
diff --git a/src/df.c b/src/df.c
c2acb1
index 5b9e8fd..e0ebed7 100644
c2acb1
--- a/src/df.c
c2acb1
+++ b/src/df.c
c2acb1
@@ -632,9 +632,11 @@ filter_mount_list (bool devices_only)
c2acb1
          On Linux we probably have me_dev populated from /proc/self/mountinfo,
c2acb1
          however we still stat() in case another device was mounted later.  */
c2acb1
       if ((me->me_remote && show_local_fs)
c2acb1
+          || (!selected_fstype (me->me_type) || excluded_fstype (me->me_type))
c2acb1
           || -1 == stat (me->me_mountdir, &buf))
c2acb1
         {
c2acb1
-          /* If remote, and showing just local, add ME for filtering later.
c2acb1
+          /* If remote, and showing just local, or FS type is excluded,
c2acb1
+             add ME for filtering later.
c2acb1
              If stat failed; add ME to be able to complain about it later.  */
c2acb1
           buf.st_dev = me->me_dev;
c2acb1
         }
c2acb1
-- 
c2acb1
2.13.6
c2acb1
c2acb1
c2acb1
From a4a61effe74766cdf047d6af52cf63613057bd87 Mon Sep 17 00:00:00 2001
c2acb1
From: Kamil Dudka <kdudka@redhat.com>
c2acb1
Date: Thu, 23 Nov 2017 17:30:09 +0100
c2acb1
Subject: [PATCH 2/2] df: limit the stat() call optimization for dummy file
c2acb1
 systems only
c2acb1
c2acb1
Otherwise 'df -t rootfs' mistakenly shows a dummy file system without
c2acb1
using the -a option, because the dummy file system is shadowed by the
c2acb1
actual root file system entry, for which we optimize out the stat()
c2acb1
call.
c2acb1
c2acb1
The problem fixed by this patch is not observable on Fedora because
c2acb1
/proc/self/mountinfo (which we do not use on RHEL) does not contain
c2acb1
the rootfs mount entry.
c2acb1
---
c2acb1
 src/df.c | 3 ++-
c2acb1
 1 file changed, 2 insertions(+), 1 deletion(-)
c2acb1
c2acb1
diff --git a/src/df.c b/src/df.c
c2acb1
index adade6d..4c6131e 100644
c2acb1
--- a/src/df.c
c2acb1
+++ b/src/df.c
c2acb1
@@ -632,7 +632,8 @@ filter_mount_list (bool devices_only)
c2acb1
          On Linux we probably have me_dev populated from /proc/self/mountinfo,
c2acb1
          however we still stat() in case another device was mounted later.  */
c2acb1
       if ((me->me_remote && show_local_fs)
c2acb1
-          || (!selected_fstype (me->me_type) || excluded_fstype (me->me_type))
c2acb1
+          || (me->me_dummy && (excluded_fstype (me->me_type)
c2acb1
+              || !selected_fstype (me->me_type)))
c2acb1
           || -1 == stat (me->me_mountdir, &buf))
c2acb1
         {
c2acb1
           /* If remote, and showing just local, or FS type is excluded,
c2acb1
-- 
c2acb1
2.13.6
c2acb1