md: clear WantReplacement once disk is removed
We can clear 'WantReplacement' flag directly no matter it's replacement existed or not since the semantic is same as before. Also since the disk is removed from array, then it is straightforward to remove 'WantReplacement' flag and the comments in raid10/5 can be removed as well. Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: Shaohua Li <shli@fb.com>
This commit is contained in:

committed by
Shaohua Li

parent
296617581e
commit
e5bc9c3c54
@@ -7603,15 +7603,12 @@ static int raid5_remove_disk(struct mddev *mddev, struct md_rdev *rdev)
|
||||
* but will never see neither - if they are careful
|
||||
*/
|
||||
p->replacement = NULL;
|
||||
clear_bit(WantReplacement, &rdev->flags);
|
||||
|
||||
if (!err)
|
||||
err = log_modify(conf, p->rdev, true);
|
||||
} else
|
||||
/* We might have just removed the Replacement as faulty-
|
||||
* clear the bit just in case
|
||||
*/
|
||||
clear_bit(WantReplacement, &rdev->flags);
|
||||
}
|
||||
|
||||
clear_bit(WantReplacement, &rdev->flags);
|
||||
abort:
|
||||
|
||||
print_raid5_conf(conf);
|
||||
|
Reference in New Issue
Block a user