Revision 0dd1e3773ae8afc4bfdce782bdeffc10f9cae6ec authored by Jan Stancek on 22 December 2019, 12:33:24 UTC, committed by Linus Torvalds on 22 December 2019, 17:47:47 UTC
LTP pipeio_1 test is hanging with v5.5-rc2-385-gb8e382a185eb,
with read side observing empty pipe and sleeping and write
side running out of space and then sleeping as well. In this
scenario there are 5 writers and 1 reader.

Problem is that after pipe_write() reacquires pipe lock, it
re-checks for empty pipe with potentially stale 'head' and
doesn't wake up read side anymore. pipe->tail can advance
beyond 'head', because there are multiple writers.

Use pipe->head for empty pipe check after reacquiring lock
to observe current state.

Testing: With patch, LTP pipeio_1 ran successfully in loop for 1 hour.
         Without patch it hanged within a minute.

Fixes: 1b6b26ae7053 ("pipe: fix and clarify pipe write wakeup logic")
Reported-by: Rachel Sibley <rasibley@redhat.com>
Signed-off-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent b8e382a
History
File Mode Size
Kconfig -rw-r--r-- 1.2 KB
Makefile -rw-r--r-- 378 bytes
acl.c -rw-r--r-- 5.8 KB
acl.h -rw-r--r-- 1.5 KB
balloc.c -rw-r--r-- 44.7 KB
dir.c -rw-r--r-- 16.9 KB
ext2.h -rw-r--r-- 28.1 KB
file.c -rw-r--r-- 5.2 KB
ialloc.c -rw-r--r-- 18.3 KB
inode.c -rw-r--r-- 48.0 KB
ioctl.c -rw-r--r-- 4.1 KB
namei.c -rw-r--r-- 9.4 KB
super.c -rw-r--r-- 44.4 KB
symlink.c -rw-r--r-- 916 bytes
xattr.c -rw-r--r-- 28.9 KB
xattr.h -rw-r--r-- 3.3 KB
xattr_security.c -rw-r--r-- 1.4 KB
xattr_trusted.c -rw-r--r-- 1.1 KB
xattr_user.c -rw-r--r-- 1.2 KB

back to top