Commit 0e9fb6f1 authored by Vasily Averin's avatar Vasily Averin Committed by Miklos Szeredi
Browse files

fuse: BUG_ON correction in fuse_dev_splice_write()



commit 96354535 ("fuse: reduce allocation size for splice_write")
changed size of bufs array, so BUG_ON which checks the index of the array
shold also be fixed.

[SzM: turn BUG_ON into WARN_ON]

Fixes: 96354535 ("fuse: reduce allocation size for splice_write")
Signed-off-by: default avatarVasily Averin <vvs@virtuozzo.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent a5d8422c
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1977,8 +1977,9 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe,
		struct pipe_buffer *ibuf;
		struct pipe_buffer *obuf;

		BUG_ON(nbuf >= pipe->ring_size);
		BUG_ON(tail == head);
		if (WARN_ON(nbuf >= count || tail == head))
			goto out_free;

		ibuf = &pipe->bufs[tail & mask];
		obuf = &bufs[nbuf];