Skip to content

Commit ebda52f

Browse files
Yufen Yuliu-song-6
authored andcommitted
raid1: simplify raid1_error function
Remove redundance set_bit and let code simplify. Signed-off-by: Yufen Yu <yuyufen@huawei.com> Signed-off-by: Song Liu <songliubraving@fb.com>
1 parent f1e5b62 commit ebda52f

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎drivers/md/raid1.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,11 +1603,9 @@ static void raid1_error(struct mddev *mddev, struct md_rdev *rdev)
16031603
return;
16041604
}
16051605
set_bit(Blocked, &rdev->flags);
1606-
if (test_and_clear_bit(In_sync, &rdev->flags)) {
1606+
if (test_and_clear_bit(In_sync, &rdev->flags))
16071607
mddev->degraded++;
1608-
set_bit(Faulty, &rdev->flags);
1609-
} else
1610-
set_bit(Faulty, &rdev->flags);
1608+
set_bit(Faulty, &rdev->flags);
16111609
spin_unlock_irqrestore(&conf->device_lock, flags);
16121610
/*
16131611
* if recovery is running, make sure it aborts.

0 commit comments

Comments
 (0)