Skip to content

Commit 76f6777

Browse files
dhowellstorvalds
authored andcommitted
pipe: Fix iteration end check in fuse_dev_splice_write()
Fix the iteration end check in fuse_dev_splice_write(). The iterator position can only be compared with == or != since wrappage may be involved. Fixes: 8cefc10 ("pipe: Use head and tail pointers for the ring, not cursor and length") Reported-by: Linus Torvalds <[email protected]> Signed-off-by: David Howells <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 43a2898 commit 76f6777

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/fuse/dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1965,7 +1965,7 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe,
19651965

19661966
nbuf = 0;
19671967
rem = 0;
1968-
for (idx = tail; idx < head && rem < len; idx++)
1968+
for (idx = tail; idx != head && rem < len; idx++)
19691969
rem += pipe->bufs[idx & mask].len;
19701970

19711971
ret = -EINVAL;

0 commit comments

Comments
 (0)