Skip to content

Commit 55251fb

Browse files
damien-lemoalaxboe
authored andcommitted
block: Do not force full zone append completion in req_bio_endio()
This reverts commit 748dc0b. Partial zone append completions cannot be supported as there is no guarantees that the fragmented data will be written sequentially in the same manner as with a full command. Commit 748dc0b ("block: fix partial zone append completion handling in req_bio_endio()") changed req_bio_endio() to always advance a partially failed BIO by its full length, but this can lead to incorrect accounting. So revert this change and let low level device drivers handle this case by always failing completely zone append operations. With this revert, users will still see an IO error for a partially completed zone append BIO. Fixes: 748dc0b ("block: fix partial zone append completion handling in req_bio_endio()") Cc: [email protected] Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 038105a commit 55251fb

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

block/blk-mq.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -770,16 +770,11 @@ static void req_bio_endio(struct request *rq, struct bio *bio,
770770
/*
771771
* Partial zone append completions cannot be supported as the
772772
* BIO fragments may end up not being written sequentially.
773-
* For such case, force the completed nbytes to be equal to
774-
* the BIO size so that bio_advance() sets the BIO remaining
775-
* size to 0 and we end up calling bio_endio() before returning.
776773
*/
777-
if (bio->bi_iter.bi_size != nbytes) {
774+
if (bio->bi_iter.bi_size != nbytes)
778775
bio->bi_status = BLK_STS_IOERR;
779-
nbytes = bio->bi_iter.bi_size;
780-
} else {
776+
else
781777
bio->bi_iter.bi_sector = rq->__sector;
782-
}
783778
}
784779

785780
bio_advance(bio, nbytes);

0 commit comments

Comments
 (0)