]> www.infradead.org Git - users/dwmw2/linux.git/commit
md/raid1: Handle bio_split() errors
authorJohn Garry <john.g.garry@oracle.com>
Mon, 11 Nov 2024 11:21:49 +0000 (11:21 +0000)
committerJens Axboe <axboe@kernel.dk>
Mon, 11 Nov 2024 15:35:46 +0000 (08:35 -0700)
commitb1a7ad8b5c4fa28325ee7b369a2d545d3e16ccde
tree36e8ba4fe74bb9fa15da65a1daed181e0ee865ef
parent74538fdac3e85aae55eb4ed786478ed2384cb85d
md/raid1: Handle bio_split() errors

Add proper bio_split() error handling. For any error, call
raid_end_bio_io() and return.

For the case of an in the write path, we need to undo the increment in
the rdev pending count and NULLify the r1_bio->bios[] pointers.

For read path failure, we need to undo rdev pending count increment from
the earlier read_balance() call.

Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20241111112150.3756529-6-john.g.garry@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/raid1.c