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-- 2.7 KB
Makefile -rw-r--r-- 313 bytes
compress.h -rw-r--r-- 1.4 KB
data.c -rw-r--r-- 8.6 KB
decompressor.c -rw-r--r-- 8.1 KB
dir.c -rw-r--r-- 3.4 KB
erofs_fs.h -rw-r--r-- 9.6 KB
inode.c -rw-r--r-- 8.1 KB
internal.h -rw-r--r-- 11.9 KB
namei.c -rw-r--r-- 5.9 KB
super.c -rw-r--r-- 14.5 KB
tagptr.h -rw-r--r-- 3.0 KB
utils.c -rw-r--r-- 7.5 KB
xattr.c -rw-r--r-- 16.6 KB
xattr.h -rw-r--r-- 2.4 KB
zdata.c -rw-r--r-- 35.7 KB
zdata.h -rw-r--r-- 4.6 KB
zmap.c -rw-r--r-- 12.0 KB
zpvec.h -rw-r--r-- 3.5 KB

back to top