diff options
| author | Yu Kuai <[email protected]> | 2024-10-31 03:31:12 +0000 |
|---|---|---|
| committer | Song Liu <[email protected]> | 2024-11-06 00:08:39 +0000 |
| commit | ff31a7ef2b13aae27203d7fc29280ab0a2f8bf18 (patch) | |
| tree | bbecfd3f1eed48e66094e4d67715444729c78a27 /drivers/md/raid1.c | |
| parent | md/raid1: factor out helper to handle blocked rdev from raid1_write_request() (diff) | |
| download | kernel-ff31a7ef2b13aae27203d7fc29280ab0a2f8bf18.tar.gz kernel-ff31a7ef2b13aae27203d7fc29280ab0a2f8bf18.zip | |
md/raid1: don't wait for Faulty rdev in wait_blocked_rdev()
Faulty rdev should never be accessed anymore, hence there is no point to
wait for bad block to be acknowledged in this case while handling write
request.
Signed-off-by: Yu Kuai <[email protected]>
Tested-by: Mariusz Tkaczyk <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Song Liu <[email protected]>
Diffstat (limited to 'drivers/md/raid1.c')
| -rw-r--r-- | drivers/md/raid1.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 1679c1e9b3d5..cd3e94dceabc 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1425,25 +1425,16 @@ retry: if (!rdev) continue; - if (test_bit(Blocked, &rdev->flags)) { - if (bio->bi_opf & REQ_NOWAIT) - return false; - - mddev_add_trace_msg(rdev->mddev, "raid1 wait rdev %d blocked", - rdev->raid_disk); - atomic_inc(&rdev->nr_pending); - md_wait_for_blocked_rdev(rdev, rdev->mddev); - goto retry; - } - /* don't write here until the bad block is acknowledged */ if (test_bit(WriteErrorSeen, &rdev->flags) && rdev_has_badblock(rdev, bio->bi_iter.bi_sector, - bio_sectors(bio)) < 0) { + bio_sectors(bio)) < 0) + set_bit(BlockedBadBlocks, &rdev->flags); + + if (rdev_blocked(rdev)) { if (bio->bi_opf & REQ_NOWAIT) return false; - set_bit(BlockedBadBlocks, &rdev->flags); mddev_add_trace_msg(rdev->mddev, "raid1 wait rdev %d blocked", rdev->raid_disk); atomic_inc(&rdev->nr_pending); |
