On 08/01/2017 10:02 AM, Kamil Dudka wrote: > On Tuesday, August 01, 2017 01:54:56 Bernhard Voelker wrote: >> The attached fixes a hang for unaccessible NFS mounts which >> are automounted by systemd. > > The summary mentions 'df -l', which is mapped to the show_local_fs flag. > However, the condition you are adding does not use the flag at all. Why? > > The condition already contains a special handling for 'df -l': > > (me->me_remote && show_local_fs) > > Why does not it work without your patch?
I admit the relation is not so obvious so I tried to explain in the commit message. The point is that the mount point of the systemd.automount(5) is of type "autofs" (where me_dummy=true), and when it would be accessed, then systemd would over-mount the same mount point with the remote NFS file system. Now I think df(1) should not necessarily trigger to automount file systems, regardless wether they are local or remote. The new condition therefore avoid the stat() on dummy file systems (which includes the "autofs" entry of the systemd automounter), and uses the same condition as that which filters out dummy entries anyway in get_dev(). In effect, this prevents to trigger the automounting. If the remote file system is mounted, then the existing condition prevents to stat() it for the -l case. > How exactly looks the mount entry you want to skip the stat() call for? 133 59 0:43 / /mnt/scratch rw,relatime shared:77 - autofs systemd-1 rw,fd=25,pgrp=1,timeout=0,minproto=5,maxproto=5,direct > What is the full content of *me in this case? Sorry, I don't have access to my other test system, but I hope the above explains enough. > Is there a good reason for http://bugzilla.suse.com/show_bug.cgi?id=1043059 > not being accessible for free? Well, it's a bug against SLES12sp2, and some customers don't seem to want those being visible to everybody. I (as openSUSE co-maintainer) can only see it because I was asked if the patch could be included upstreams. I'm not sure I could make it available for you. Josef could probably. Thanks & Have a nice day, Berny
