]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'for-linus' of git://neil.brown.name/md
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 6 Nov 2008 23:50:11 +0000 (15:50 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 6 Nov 2008 23:50:11 +0000 (15:50 -0800)
* 'for-linus' of git://neil.brown.name/md:
  md: linear: Fix a division by zero bug for very small arrays.
  md: fix bug in raid10 recovery.
  md: revert the recent addition of a call to the BLKRRPART ioctl.

drivers/md/linear.c
drivers/md/md.c
drivers/md/raid10.c

index 190147c79e79fbbe9b0e2c0935aa7ac697464a1b..3b90c5c924ecc25a33ba4268d22d65b74142fece 100644 (file)
@@ -148,6 +148,8 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
 
        min_sectors = conf->array_sectors;
        sector_div(min_sectors, PAGE_SIZE/sizeof(struct dev_info *));
+       if (min_sectors == 0)
+               min_sectors = 1;
 
        /* min_sectors is the minimum spacing that will fit the hash
         * table in one PAGE.  This may be much smaller than needed.
index 9abf6ed16535c925366eb936887f21425be7edc8..1b1d32694f6fc8eddf7a8c4cccc6d836b5e88054 100644 (file)
@@ -3884,7 +3884,6 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open)
        if (mode == 0) {
                mdk_rdev_t *rdev;
                struct list_head *tmp;
-               struct block_device *bdev;
 
                printk(KERN_INFO "md: %s stopped.\n", mdname(mddev));
 
@@ -3941,11 +3940,6 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open)
                mddev->degraded = 0;
                mddev->barriers_work = 0;
                mddev->safemode = 0;
-               bdev = bdget_disk(mddev->gendisk, 0);
-               if (bdev) {
-                       blkdev_ioctl(bdev, 0, BLKRRPART, 0);
-                       bdput(bdev);
-               }
                kobject_uevent(&disk_to_dev(mddev->gendisk)->kobj, KOBJ_CHANGE);
 
        } else if (mddev->pers)
index da5129a24b18142d39595c86415bdef40612e353..970a96ef9b1841badb7b43657d46263e67a9e722 100644 (file)
@@ -1137,7 +1137,7 @@ static int raid10_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
        if (!enough(conf))
                return -EINVAL;
 
-       if (rdev->raid_disk)
+       if (rdev->raid_disk >= 0)
                first = last = rdev->raid_disk;
 
        if (rdev->saved_raid_disk >= 0 &&