mount: mountinfo event is supposed to always arrive before SIGCHLD
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>
Sat, 20 Jan 2018 20:05:52 +0000 (20:05 +0000)
committerAlan Jenkins <alan.christopher.jenkins@gmail.com>
Tue, 23 Jan 2018 11:09:06 +0000 (11:09 +0000)
commit006aabbd052ce46ec35c8f90afe042f84c81c643
tree1001de58ad964e9481c2c6241afb485ef2010fee
parent25cd49647c83bacaee591afbc9b6fc047be66b58
mount: mountinfo event is supposed to always arrive before SIGCHLD

"Due to the io event priority logic we can be sure the new mountinfo is
loaded before we process the SIGCHLD for the mount command."

I think this is a reasonable expectation.  But if it works, then the
other comment must be false:

"Note that mount(8) returning and the kernel sending us a mount table
change event might happen out-of-order."

Therefore we can clean up the code for the latter.

If this is working as advertised, then we can make sure that mount units
fail if the mount we thought we were creating did not actually appear,
due to races or trickery (or because /sbin/mount did something unexpected
despite returning EXIT_SUCCESS).

Include a specific warning message for this failure.

If we give up when the mount point is still mounted after 32 successful
calls to /sbin/umount, that seems a fairly similar case.  So make that
message a LOG_WARN as well (not LOG_DEBUG). Also, this was recently changed to only
retry while umount is returning EXIT_SUCCESS; in that case in particular
there would be no other messages in the log to suggest what had happened.
src/core/mount.c
src/core/mount.h