Commit 061e7151 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] md: prevent oops when drive set faulty in inactive md array.

hot_add_disk and hot_remove_disk check mddev->pers before proceeding.
set_disk_faulty should too.
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a2bfbd42
......@@ -2441,6 +2441,9 @@ static int set_disk_faulty(mddev_t *mddev, dev_t dev)
{
mdk_rdev_t *rdev;
if (mddev->pers == NULL)
return -ENODEV;
rdev = find_rdev(mddev, dev);
if (!rdev)
return -ENODEV;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment