LKML Archive on
 help / color / Atom feed
From: Alexey Dobriyan <>
Subject: [PATCH -mm] proc: fixup test for read
Date: Sat, 17 Mar 2018 02:21:47 +0300
Message-ID: <20180316232147.GA20146@avx2> (raw)

/proc/kmsg can and will block if read under root.

Signed-off-by: Alexey Dobriyan <>

 tools/testing/selftests/proc/read.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/tools/testing/selftests/proc/read.c
+++ b/tools/testing/selftests/proc/read.c
@@ -54,7 +54,8 @@ static void f_reg(DIR *d, const char *filename)
 	int fd;
 	ssize_t rv;
-	fd = openat(dirfd(d), filename, O_RDONLY);
+	/* read from /proc/kmsg can block */
+	fd = openat(dirfd(d), filename, O_RDONLY|O_NONBLOCK);
 	if (fd == -1)
 	rv = read(fd, buf, sizeof(buf));

             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-16 23:21 Alexey Dobriyan [this message]
2018-03-16 23:28 ` Andrew Morton

Reply instructions:

You may reply publically 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=20180316232147.GA20146@avx2 \ \ \ \

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

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git

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

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone