]> git.baikalelectronics.ru Git - kernel.git/commit
loop: handle short DIO reads
authorJens Axboe <axboe@kernel.dk>
Fri, 13 Apr 2018 22:25:57 +0000 (16:25 -0600)
committerJens Axboe <axboe@kernel.dk>
Sun, 15 Apr 2018 04:34:27 +0000 (22:34 -0600)
commit247b6059c6edebaed57388331b31d0eabe4175dc
treed556b07b0cab85b22b3697fd85705d7e6ed8dd71
parentafffacde813e6700c341f990787d413594621b8f
loop: handle short DIO reads

We ran into an issue with loop and btrfs, where btrfs would complain about
checksum errors. It turns out that is because we don't handle short reads
at all, we just zero fill the remainder. Worse than that, we don't handle
the filling properly, which results in loop trying to advance a single
bio by much more than its size, since it doesn't take chaining into
account.

Handle short reads appropriately, by simply retrying at the new correct
offset. End the remainder of the request with EIO, if we get a 0 read.

Fixes: 750efacd3f8c ("block: loop: support DIO & AIO")
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.c