Skip to content

Commit

Permalink
relayfs: fix infinite loop with splice()
Browse files Browse the repository at this point in the history
Running kmemtraced, which uses splice() on relayfs, causes a hard lock on
x86-64 SMP.  As described by Tom Zanussi:

  It looks like you hit the same problem as described here:

  commit 8191ecd

      splice: fix infinite loop in generic_file_splice_read()

  relay uses the same loop but it never got noticed or fixed.

Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Tested-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Tom Zanussi <tzanussi@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Tom Zanussi authored and Linus Torvalds committed Dec 10, 2008
1 parent 3613712 commit fbb5b7a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions kernel/relay.c
Original file line number Diff line number Diff line change
Expand Up @@ -1317,12 +1317,9 @@ static ssize_t relay_file_splice_read(struct file *in,
if (ret < 0)
break;
else if (!ret) {
if (spliced)
break;
if (flags & SPLICE_F_NONBLOCK) {
if (flags & SPLICE_F_NONBLOCK)
ret = -EAGAIN;
break;
}
break;
}

*ppos += ret;
Expand Down

0 comments on commit fbb5b7a

Please sign in to comment.