diff options
author | David Howells <dhowells@redhat.com> | 2019-12-06 22:34:51 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-12-06 22:57:04 +0100 |
commit | 76f6777c9cc04efe8036b1d2aa76e618c1631cc6 (patch) | |
tree | d6383685fe462de7eb3007541ee2e26a03b2927d /fs/fuse/dev.c | |
parent | Merge tag 'powerpc-5.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/po... (diff) | |
download | linux-76f6777c9cc04efe8036b1d2aa76e618c1631cc6.tar.xz linux-76f6777c9cc04efe8036b1d2aa76e618c1631cc6.zip |
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: 8cefc107ca54 ("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>
Diffstat (limited to '')
-rw-r--r-- | fs/fuse/dev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index d4e6691d2d92..8e02d76fe104 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1965,7 +1965,7 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe, nbuf = 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; ret = -EINVAL; |