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
Changes -rw-r--r-- 9.1 KB
Kconfig -rw-r--r-- 1000 bytes
Makefile -rw-r--r-- 234 bytes
affs.h -rw-r--r-- 10.9 KB
amigaffs.c -rw-r--r-- 11.3 KB
amigaffs.h -rw-r--r-- 3.0 KB
bitmap.c -rw-r--r-- 8.3 KB
dir.c -rw-r--r-- 3.4 KB
file.c -rw-r--r-- 24.3 KB
inode.c -rw-r--r-- 10.6 KB
namei.c -rw-r--r-- 13.1 KB
super.c -rw-r--r-- 16.7 KB
symlink.c -rw-r--r-- 1.6 KB

back to top