浏览代码

Merge branch 'for-linus' of git://neil.brown.name/md

* '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.
Linus Torvalds 17 年之前
父节点
当前提交
71fe3fcaf6
共有 3 个文件被更改,包括 3 次插入7 次删除
  1. 2 0
      drivers/md/linear.c
  2. 0 6
      drivers/md/md.c
  3. 1 1
      drivers/md/raid10.c

+ 2 - 0
drivers/md/linear.c

@@ -148,6 +148,8 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
 
 
 	min_sectors = conf->array_sectors;
 	min_sectors = conf->array_sectors;
 	sector_div(min_sectors, PAGE_SIZE/sizeof(struct dev_info *));
 	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
 	/* min_sectors is the minimum spacing that will fit the hash
 	 * table in one PAGE.  This may be much smaller than needed.
 	 * table in one PAGE.  This may be much smaller than needed.

+ 0 - 6
drivers/md/md.c

@@ -3884,7 +3884,6 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open)
 	if (mode == 0) {
 	if (mode == 0) {
 		mdk_rdev_t *rdev;
 		mdk_rdev_t *rdev;
 		struct list_head *tmp;
 		struct list_head *tmp;
-		struct block_device *bdev;
 
 
 		printk(KERN_INFO "md: %s stopped.\n", mdname(mddev));
 		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->degraded = 0;
 		mddev->barriers_work = 0;
 		mddev->barriers_work = 0;
 		mddev->safemode = 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);
 		kobject_uevent(&disk_to_dev(mddev->gendisk)->kobj, KOBJ_CHANGE);
 
 
 	} else if (mddev->pers)
 	} else if (mddev->pers)

+ 1 - 1
drivers/md/raid10.c

@@ -1137,7 +1137,7 @@ static int raid10_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
 	if (!enough(conf))
 	if (!enough(conf))
 		return -EINVAL;
 		return -EINVAL;
 
 
-	if (rdev->raid_disk)
+	if (rdev->raid_disk >= 0)
 		first = last = rdev->raid_disk;
 		first = last = rdev->raid_disk;
 
 
 	if (rdev->saved_raid_disk >= 0 &&
 	if (rdev->saved_raid_disk >= 0 &&