Linux-Fsdevel Archive on
 help / color / Atom feed
From: Ian Kent <>
To: Andrew Morton <>
Cc: autofs mailing list <>,
	linux-fsdevel <>,
	Kernel Mailing List <>,
	NeilBrown <>
Subject: [PATCH] autofs: clear O_NONBLOCK on the pipe.
Date: Tue, 12 Feb 2019 09:38:29 +0800
Message-ID: <154993550902.3321.1183632970046073478.stgit@pluto-themaw-net> (raw)

From: NeilBrown <>

autofs does not expect the pipe it is given
to have O_NONBLOCK set - specifically if __kernel_write()
in autofs_write() returns -EAGAIN, this is treated
as a fatal error and the pipe is closed.

For safety autofs should, therefore, clear the O_NONBLOCK flag.

Releases of systemd prior to 8th February 2019 used
and thus (inadvertently) set this flag.

Signed-off-by: NeilBrown <>
Signed-off-by: Ian Kent <>
 fs/autofs/autofs_i.h |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/autofs/autofs_i.h b/fs/autofs/autofs_i.h
index b735f2b1e462..70c132acdab1 100644
--- a/fs/autofs/autofs_i.h
+++ b/fs/autofs/autofs_i.h
@@ -216,6 +216,8 @@ static inline int autofs_prepare_pipe(struct file *pipe)
 		return -EINVAL;
 	/* We want a packet pipe */
 	pipe->f_flags |= O_DIRECT;
+	/* We don't expect -EAGAIN */
+	pipe->f_flags &= ~O_NONBLOCK;
 	return 0;

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=154993550902.3321.1183632970046073478.stgit@pluto-themaw-net \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Fsdevel Archive on

Archives are clonable:
	git clone --mirror linux-fsdevel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-fsdevel linux-fsdevel/ \
	public-inbox-index linux-fsdevel

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone