]> 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 ceb24afdc147aada31741b10213443375617257f..a361398875d0f09adce0bac4c3dedad13e233ad5 100644 (file)
@@ -3739,7 +3739,7 @@ static int bio_fits_rdev(struct bio *bi)
        if ((bi->bi_size>>9) > queue_max_sectors(q))
                return 0;
        blk_recount_segments(q, bi);
-       if (bi->bi_phys_segments > queue_max_phys_segments(q))
+       if (bi->bi_phys_segments > queue_max_segments(q))
                return 0;
 
        if (q->merge_bvec_fn)
@@ -4680,7 +4680,7 @@ static int raid5_alloc_percpu(raid5_conf_t *conf)
 {
        unsigned long cpu;
        struct page *spare_page;
-       struct raid5_percpu *allcpus;
+       struct raid5_percpu __percpu *allcpus;
        void *scribble;
        int err;
 
@@ -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;
 }