]> git.ipfire.org Git - thirdparty/systemd.git/commit
automount: don't pass non-blocking pipe to kernel.
authorNeilBrown <neilb@suse.com>
Thu, 7 Feb 2019 22:44:06 +0000 (09:44 +1100)
committerLennart Poettering <lennart@poettering.net>
Fri, 8 Feb 2019 09:33:26 +0000 (10:33 +0100)
commit1cae151d8e38d4017ccd65ed12c459774e537bb2
treef0dc766f06de731ddd10054b7ee4c285bb23411e
parenteb7e35149600f6141e01808115859397c190bff1
automount: don't pass non-blocking pipe to kernel.

Creating a pipe with O_NONBLOCK causes both the read and the write end to
be marked as non-blocking.
The "write" end is passed to the kernel autofs module, and it does not
expect a non-blocking pipe.  If it gets -EAGAIN when trying to write
(which is unlikely, but not completely impossible), it will close the
write end of the pipe, which leads to unexpected errors.

So change the code to only set O_NONBLOCK on the "read" end of the
pipe.  This is the only end that systemd interacts with, so the only end
it should be configuring.
src/core/automount.c