Commit a8461a61 authored by NeilBrown's avatar NeilBrown

md/raid0: check for bitmap compatability when changing raid levels.

If an array has a bitmap, then it cannot be converted to raid0.
Reported-by: default avatarXiao Ni <xni@redhat.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent ac7e50a3
...@@ -685,6 +685,12 @@ static void *raid0_takeover(struct mddev *mddev) ...@@ -685,6 +685,12 @@ static void *raid0_takeover(struct mddev *mddev)
* raid10 - assuming we have all necessary active disks * raid10 - assuming we have all necessary active disks
* raid1 - with (N -1) mirror drives faulty * raid1 - with (N -1) mirror drives faulty
*/ */
if (mddev->bitmap) {
printk(KERN_ERR "md/raid0: %s: cannot takeover array with bitmap\n",
mdname(mddev));
return ERR_PTR(-EBUSY);
}
if (mddev->level == 4) if (mddev->level == 4)
return raid0_takeover_raid45(mddev); return raid0_takeover_raid45(mddev);
......
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