mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-21 14:44:06 +00:00
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: 8cefc107ca
("pipe: Use head and tail pointers for the ring, not cursor and length")
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
43a2898631
commit
76f6777c9c
1 changed files with 1 additions and 1 deletions
|
@ -1965,7 +1965,7 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe,
|
||||||
|
|
||||||
nbuf = 0;
|
nbuf = 0;
|
||||||
rem = 0;
|
rem = 0;
|
||||||
for (idx = tail; idx < head && rem < len; idx++)
|
for (idx = tail; idx != head && rem < len; idx++)
|
||||||
rem += pipe->bufs[idx & mask].len;
|
rem += pipe->bufs[idx & mask].len;
|
||||||
|
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
|
|
Loading…
Add table
Reference in a new issue