]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/md/raid5.c
md: manage redundancy group in sysfs when changing level.
[mirror_ubuntu-artful-kernel.git] / drivers / md / raid5.c
index 70ffbd071b2e797be6f715dd40de19a93c6567d3..a361398875d0f09adce0bac4c3dedad13e233ad5 100644 (file)
@@ -5090,7 +5090,9 @@ static int run(mddev_t *mddev)
        }
 
        /* Ok, everything is just fine now */
-       if (sysfs_create_group(&mddev->kobj, &raid5_attrs_group))
+       if (mddev->to_remove == &raid5_attrs_group)
+               mddev->to_remove = NULL;
+       else if (sysfs_create_group(&mddev->kobj, &raid5_attrs_group))
                printk(KERN_WARNING
                       "raid5: failed to create sysfs attributes for %s\n",
                       mdname(mddev));
@@ -5137,7 +5139,8 @@ static int stop(mddev_t *mddev)
        mddev->queue->backing_dev_info.congested_fn = NULL;
        blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
        free_conf(conf);
-       mddev->private = &raid5_attrs_group;
+       mddev->private = NULL;
+       mddev->to_remove = &raid5_attrs_group;
        return 0;
 }