Skip to content

Commit

Permalink
block: fix infinite loop for invalid zone append
Browse files Browse the repository at this point in the history
Returning 0 early from __bio_iov_append_get_pages() for the
max_append_sectors warning just creates an infinite loop since 0 means
success, and the bio will never fill from the unadvancing iov_iter. We
could turn the return into an error value, but it will already be turned
into an error value later on, so just remove the warning. Clearly no one
ever hit it anyway.

Fixes: 0512a75 ("block: Introduce REQ_OP_ZONE_APPEND")
Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20220610195830.3574005-2-kbusch@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Keith Busch authored and Jens Axboe committed Jun 27, 2022
1 parent 03c765b commit b82d9fa
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions block/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1229,9 +1229,6 @@ static int __bio_iov_append_get_pages(struct bio *bio, struct iov_iter *iter)
size_t offset;
int ret = 0;

if (WARN_ON_ONCE(!max_append_sectors))
return 0;

/*
* Move page array up in the allocated memory for the bio vecs as far as
* possible so that we can start filling biovecs from the beginning
Expand Down

0 comments on commit b82d9fa

Please sign in to comment.