]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/md/md.c
Fail safely when trying to grow an array with a write-intent bitmap.
[karo-tx-linux.git] / drivers / md / md.c
index 48afe4f7ad4c2d3538b85ec8234abfdd7c194845..6eb95451f1616f925320b8d702eb4d3a5aca8ce1 100644 (file)
@@ -4639,6 +4639,11 @@ static int update_size(mddev_t *mddev, sector_t num_sectors)
         */
        if (mddev->sync_thread)
                return -EBUSY;
+       if (mddev->bitmap)
+               /* Sorry, cannot grow a bitmap yet, just remove it,
+                * grow, and re-add.
+                */
+               return -EBUSY;
        rdev_for_each(rdev, tmp, mddev) {
                sector_t avail;
                avail = rdev->size * 2;
@@ -6237,7 +6242,11 @@ static int md_notify_reboot(struct notifier_block *this,
 
                for_each_mddev(mddev, tmp)
                        if (mddev_trylock(mddev)) {
-                               do_md_stop (mddev, 1, 0);
+                               /* Force a switch to readonly even array
+                                * appears to still be in use.  Hence
+                                * the '100'.
+                                */
+                               do_md_stop (mddev, 1, 100);
                                mddev_unlock(mddev);
                        }
                /*