loop: don't increment p->offset with (size_t) -EINVAL
PATCH 1/1 loop: don't increment p->offset with (size_t) -EINVAL
Upon a 'transfer error block' size is set to -EINVAL, but this becomes positive since size is unsigned: p->offset still gets incremented.
Signed-off-by Roel Kluin <[email protected]>
---
drivers/block/loop.c +1 -2
@@ -392,8 +392,7 @@ lo_splice_actor(struct pipe_inode_info *pipe, struct pipe_buffer *buf,struct loop_device *lo = p->lo;struct page *page = buf->page;sector_t IV ; -size_t size; -int ret; +int size, ret; ret = buf->ops->confirm (pipe, buf);if (unlikely (ret))
Quoted 10 lines · Roel Kluin
Upon a 'transfer error block' size is set to
-EINVAL, but this becomes positive since size is unsigned:p->offsetstill gets incremented.Signed-off-by Roel Kluin <[email protected]>---
drivers/block/loop.c +0
-0
drivers/block/loop.c lo_splice_actor(struct pipe_inode_info *pipe, struct pipe_buffer *buf, · line 398
Quoted 9 lines
drivers/block/loop.c +1
-2@@ -392,8 +392,7 @@ lo_splice_actor(struct pipe_inode_info *pipe, struct pipe_buffer *buf,struct loop_device *lo = p->lo;struct page *page = buf->page;sector_t IV ; -size_t size; -int ret; +int size, ret; ret = buf->ops->confirm (pipe, buf);if (unlikely (ret))
Good catch! Applied.
Signature · 1 line
Jens Axboe