Skip to content
/ linux Public

Commit 83cbe4b

Browse files
Li NanSasha Levin
authored andcommitted
md/raid10: fix any_working flag handling in raid10_sync_request
[ Upstream commit 99582ed ] In raid10_sync_request(), 'any_working' indicates if any IO will be submitted. When there's only one In_sync disk with badblocks, 'any_working' might be set to 1 but no IO is submitted. Fix it by setting 'any_working' after badblock checks. Link: https://lore.kernel.org/linux-raid/20260105110300.1442509-11-linan666@huaweicloud.com Fixes: e875ece ("md/raid10 record bad blocks as needed during recovery.") Signed-off-by: Li Nan <linan122@huawei.com> Reviewed-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Yu Kuai <yukuai@fnnas.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent f130001 commit 83cbe4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/md/raid10.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3535,7 +3535,6 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr,
35353535
!test_bit(In_sync, &rdev->flags))
35363536
continue;
35373537
/* This is where we read from */
3538-
any_working = 1;
35393538
sector = r10_bio->devs[j].addr;
35403539

35413540
if (is_badblock(rdev, sector, max_sync,
@@ -3550,6 +3549,7 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr,
35503549
continue;
35513550
}
35523551
}
3552+
any_working = 1;
35533553
bio = r10_bio->devs[0].bio;
35543554
bio->bi_next = biolist;
35553555
biolist = bio;

0 commit comments

Comments
 (0)