]> git.baikalelectronics.ru Git - kernel.git/commit
block: advance iov_iter on bio_add_hw_page failure
authorNaohiro Aota <naohiro.aota@wdc.com>
Wed, 28 Oct 2020 07:25:36 +0000 (16:25 +0900)
committerJens Axboe <axboe@kernel.dk>
Wed, 28 Oct 2020 13:51:02 +0000 (07:51 -0600)
commit1fc6c7434713ad5295dc51d74b8018f47b8e56c7
tree5b6040a3996fb61fa60e053e7800589cc5c3f72b
parent903edcfe5734c428ec2eef33fc23de91eb95df76
block: advance iov_iter on bio_add_hw_page failure

When the bio's size reaches max_append_sectors, bio_add_hw_page returns
0 then __bio_iov_append_get_pages returns -EINVAL. This is an expected
result of building a small enough bio not to be split in the IO path.
However, iov_iter is not advanced in this case, causing the same pages
are filled for the bio again and again.

Fix the case by properly advancing the iov_iter for already processed
pages.

Fixes: bfecb9aac701 ("block: Introduce REQ_OP_ZONE_APPEND")
Cc: stable@vger.kernel.org # 5.8+
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c