Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Fix race between explicit mount and handling automount request from kernel #5916
+18
−15
Conversation
|
Patch looks good, but could you add a short comment about this issue to the if block you are changing? Otherwise the next one looking at these sources or changing them might break this again. Something brief suffices, possibly containing a link to this issue containing the longer explanation... Otherwirse looks excellent! thanks for spending the time to track this down, much appreciated. |
poettering
added
bug
pid1
reviewed/needs-rework
labels
May 9, 2017
|
No problem. I've added a brief comment. |
poettering
merged commit e7d54bf
into
systemd:master
May 10, 2017
|
thanks! |
poettering
removed
the
reviewed/needs-rework
label
May 10, 2017
added a commit
to euank/systemd
that referenced
this pull request
Jun 29, 2017
dilchenko
referenced this pull request
in elastic/beats
Dec 15, 2017
Open
Metricbeat requires binfmt_misc support which has a bug in latest CentOS 7 #5896
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
AnchorCat commentedMay 9, 2017
•
Edited 1 time
-
AnchorCat
May 9, 2017
If a process accesses an autofs filesystem while systemd is in the middle of starting the mount unit on top of it, it is possible for the
autofs_ptype_missing_directrequest from the kernel to be received afterthe mount unit has been fully started:
systemd needs to respond to this request, otherwise the kernel will continue to block access to the mount point.
While I have only encountered this bug during boot on systems with automounted network filesystems, it can be triggered reasonably reliable with an artificial test case as follows:
The delay in the
sleep 0.006command needs to be tweaked so that the automount request is sometimes, but not always, the trigger for systemd to mount the unit, and such that "Automount point already active?" only occasionally appears in the journal. Eventually the "Got automount request" message will appear after "Mounted /tmp/target", showing that the autofs request was received too late:When this happens the
catcommand will hang, even though the/tmp/targetfilesystem was successfully mounted. Anything else that tries to access/tmp/targetwill also hang until it is unmounted (viaumountorsystemctl stop).