Blame SOURCES/coreutils-8.22-df-dummy-local.patch

02b701
From 20e22775051d4392b9e41b717711535178395ec4 Mon Sep 17 00:00:00 2001
02b701
From: Josef Cejka <jcejka@suse.com>
02b701
Date: Tue, 1 Aug 2017 01:50:34 +0200
02b701
Subject: [PATCH] df: avoid stat() for dummy file systems with -l
02b701
02b701
When systemd is configured to automount a remote file system - see
02b701
'man systemd.automount(5)', then the mount point is initially
02b701
mounted by systemd with the file system type "autofs".
02b701
When the resource is used later on, then the wanted file system is
02b701
mounted over that mount point on demand.
02b701
'df -l' triggered systemd to mount the file system because it called
02b701
stat() on the mount point.
02b701
Instead of single-casing "autofs" targets, we can avoid stat()ing
02b701
all dummy file systems (which includes "autofs"), because those are
02b701
skipped later on in get_dev() anyway.
02b701
02b701
*src/df.c (filter_mount_list): Also skip dummy file systems unless
02b701
the -a option or a specific target are given.
02b701
* NEWS: Mention the fix.
02b701
02b701
Co-authored-by: Bernhard Voelker <mail@bernhard-voelker.de>
02b701
02b701
Fixes http://bugzilla.suse.com/show_bug.cgi?id=1043059
02b701
02b701
Upstream-commit: a19ff5d8179a7de38109fc78278229fd96f3941a
02b701
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
02b701
---
02b701
 src/df.c | 1 +
02b701
 1 file changed, 1 insertion(+)
02b701
02b701
diff --git a/src/df.c b/src/df.c
02b701
index c50aa80..fa20493 100644
02b701
--- a/src/df.c
02b701
+++ b/src/df.c
02b701
@@ -632,6 +632,7 @@ filter_mount_list (bool devices_only)
02b701
          On Linux we probably have me_dev populated from /proc/self/mountinfo,
02b701
          however we still stat() in case another device was mounted later.  */
02b701
       if ((me->me_remote && show_local_fs)
02b701
+          || (me->me_dummy && !show_all_fs && !show_listed_fs)
02b701
           || (!selected_fstype (me->me_type) || excluded_fstype (me->me_type))
02b701
           || -1 == stat (me->me_mountdir, &buf))
02b701
         {
02b701
-- 
02b701
2.17.2
02b701