Fix incomplete backport of commit 423f04d63cf4

Signed-off-by: Zefan Li <lizefan@huawei.com>
This commit is contained in:
Zefan Li 2016-10-09 19:00:59 +08:00
parent af706acbb5
commit 6883832be8

View file

@ -1272,11 +1272,8 @@ static void error(struct mddev *mddev, struct md_rdev *rdev)
set_bit(Blocked, &rdev->flags);
spin_lock_irqsave(&conf->device_lock, flags);
if (test_and_clear_bit(In_sync, &rdev->flags)) {
unsigned long flags;
spin_lock_irqsave(&conf->device_lock, flags);
mddev->degraded++;
set_bit(Faulty, &rdev->flags);
spin_unlock_irqrestore(&conf->device_lock, flags);
/*
* if recovery is running, make sure it aborts.
*/