mirror of
https://github.com/systemd/systemd.git
synced 2024-10-28 03:25:31 +03:00
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.
This commit is contained in:
parent
eb7e351496
commit
1cae151d8e
@ -578,10 +578,13 @@ static void automount_enter_waiting(Automount *a) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (pipe2(p, O_NONBLOCK|O_CLOEXEC) < 0) {
|
||||
if (pipe2(p, O_CLOEXEC) < 0) {
|
||||
r = -errno;
|
||||
goto fail;
|
||||
}
|
||||
r = fd_nonblock(p[0], true);
|
||||
if (r < 0)
|
||||
goto fail;
|
||||
|
||||
xsprintf(options, "fd=%i,pgrp="PID_FMT",minproto=5,maxproto=5,direct", p[1], getpgrp());
|
||||
xsprintf(name, "systemd-"PID_FMT, getpid_cached());
|
||||
|
Loading…
Reference in New Issue
Block a user