Skip to content

Commit 99582ed

Browse files
Li Nanhailan94
authored andcommitted
md/raid10: fix any_working flag handling in raid10_sync_request
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/[email protected] Fixes: e875ece ("md/raid10 record bad blocks as needed during recovery.") Signed-off-by: Li Nan <[email protected]> Reviewed-by: Yu Kuai <[email protected]> Signed-off-by: Yu Kuai <[email protected]>
1 parent 8ff59a7 commit 99582ed

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/md/raid10.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3395,7 +3395,6 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr,
33953395
!test_bit(In_sync, &rdev->flags))
33963396
continue;
33973397
/* This is where we read from */
3398-
any_working = 1;
33993398
sector = r10_bio->devs[j].addr;
34003399

34013400
if (is_badblock(rdev, sector, max_sync,
@@ -3410,6 +3409,7 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr,
34103409
continue;
34113410
}
34123411
}
3412+
any_working = 1;
34133413
bio = r10_bio->devs[0].bio;
34143414
bio->bi_next = biolist;
34153415
biolist = bio;

0 commit comments

Comments
 (0)