md/raid0: check for bitmap compatability when changing raid levels.
authorNeilBrown <neilb@suse.de>
Wed, 6 Aug 2014 06:34:27 +0000 (16:34 +1000)
committerNeilBrown <neilb@suse.de>
Fri, 8 Aug 2014 05:33:17 +0000 (15:33 +1000)
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>
drivers/md/raid0.c

index 407a99e46f6993a770c21fdfff1972b7f64063b6..cf91f5910c7c8e9422ef1beb73001c0f76cbdaf1 100644 (file)
@@ -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);