|
|
dd59ef |
From 9c4641f42bbecf63ec0a0e05caacbccd5332b831 Mon Sep 17 00:00:00 2001
|
|
|
dd59ef |
From: Philipp Thomas <pth@suse.de>
|
|
|
dd59ef |
Date: Sun, 26 Mar 2017 22:34:00 -0700
|
|
|
dd59ef |
Subject: [PATCH] df: avoid querying excluded file systems
|
|
|
dd59ef |
|
|
|
dd59ef |
* src/df.c (filter_mount_list): Avoid stat() on
|
|
|
dd59ef |
explicitly excluded file systems, which is especially
|
|
|
dd59ef |
significant in cases like `-x nfs` which may hang.
|
|
|
dd59ef |
* NEWS: Mention the bug fix.
|
|
|
dd59ef |
|
|
|
dd59ef |
Upstream-commit: 7c228bc55ed3fd6d56a6ad135438066de2f54a30
|
|
|
dd59ef |
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
|
|
|
dd59ef |
---
|
|
|
dd59ef |
src/df.c | 4 +++-
|
|
|
dd59ef |
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
dd59ef |
|
|
|
dd59ef |
diff --git a/src/df.c b/src/df.c
|
|
|
dd59ef |
index 5b9e8fd..e0ebed7 100644
|
|
|
dd59ef |
--- a/src/df.c
|
|
|
dd59ef |
+++ b/src/df.c
|
|
|
dd59ef |
@@ -632,9 +632,11 @@ filter_mount_list (bool devices_only)
|
|
|
dd59ef |
On Linux we probably have me_dev populated from /proc/self/mountinfo,
|
|
|
dd59ef |
however we still stat() in case another device was mounted later. */
|
|
|
dd59ef |
if ((me->me_remote && show_local_fs)
|
|
|
dd59ef |
+ || (!selected_fstype (me->me_type) || excluded_fstype (me->me_type))
|
|
|
dd59ef |
|| -1 == stat (me->me_mountdir, &buf))
|
|
|
dd59ef |
{
|
|
|
dd59ef |
- /* If remote, and showing just local, add ME for filtering later.
|
|
|
dd59ef |
+ /* If remote, and showing just local, or FS type is excluded,
|
|
|
dd59ef |
+ add ME for filtering later.
|
|
|
dd59ef |
If stat failed; add ME to be able to complain about it later. */
|
|
|
dd59ef |
buf.st_dev = me->me_dev;
|
|
|
dd59ef |
}
|
|
|
dd59ef |
--
|
|
|
dd59ef |
2.13.6
|