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