summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2021-10-22 17:01:44 +0200
committerJens Axboe <axboe@kernel.dk>2021-10-22 17:12:37 +0200
commit297db731847e7808881ec2123c7564067d594d39 (patch)
tree12c2b8d2a66d27482c1845d506ab5745844b38fa /block
parentblk-crypto: update inline encryption documentation (diff)
downloadlinux-297db731847e7808881ec2123c7564067d594d39.tar.xz
linux-297db731847e7808881ec2123c7564067d594d39.zip
block: fix req_bio_endio append error handling
Shinichiro Kawasaki reports that there is a bug in a recent req_bio_endio() patch causing problems with zonefs. As Shinichiro suggested, inverse the condition in zone append path to resemble how it was before: fail when it's not fully completed. Fixes: 478eb72b815f3 ("block: optimise req_bio_endio()") Reported-by: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/344ea4e334aace9148b41af5f2426da38c8aa65a.1634914228.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index d04ee72ba125..c19dfa8ea65e 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -640,7 +640,7 @@ static void req_bio_endio(struct request *rq, struct bio *bio,
* Partial zone append completions cannot be supported as the
* BIO fragments may end up not being written sequentially.
*/
- if (bio->bi_iter.bi_size == nbytes)
+ if (bio->bi_iter.bi_size != nbytes)
bio->bi_status = BLK_STS_IOERR;
else
bio->bi_iter.bi_sector = rq->__sector;