Skip to content

Commit

Permalink
md/raid0: check for bitmap compatability when changing raid levels.
Browse files Browse the repository at this point in the history
If an array has a bitmap, then it cannot be converted to raid0.

Reported-by: Xiao Ni <xni@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
  • Loading branch information
NeilBrown committed Aug 8, 2014
1 parent ac7e50a commit a8461a6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/md/raid0.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,12 @@ static void *raid0_takeover(struct mddev *mddev)
* raid10 - assuming we have all necessary active disks
* 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)
return raid0_takeover_raid45(mddev);

Expand Down

0 comments on commit a8461a6

Please sign in to comment.