block: ensure bio_iov_add_page can't fail
authorKeith Busch <kbusch@kernel.org>
Tue, 12 Jul 2022 15:32:55 +0000 (08:32 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 13 Jul 2022 20:20:41 +0000 (14:20 -0600)
commitac3c48e32c047a3781d6bc28bb5013e4431350fd
tree4b5af5028f4942cf2374c1dd65792850378137ad
parent5a044eef1265581683530e75351c19e29ee33a11
block: ensure bio_iov_add_page can't fail

Adding the page could fail on the bio_full() condition, which checks for
either exceeding the bio's max segments or total size exceeding
UINT_MAX. We already ensure the max segments can't be exceeded, so just
ensure the total size won't reach the limit. This simplifies error
handling and removes unnecessary repeated bio_full() checks.

Signed-off-by: Keith Busch <kbusch@kernel.org>
Link: https://lore.kernel.org/r/20220712153256.2202024-2-kbusch@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c