Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://neil.brown.name/md
Browse files Browse the repository at this point in the history
* '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.
  • Loading branch information
Linus Torvalds committed Nov 6, 2008
2 parents 38407aa + f1cd14a commit 71fe3fc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 2 additions & 0 deletions drivers/md/linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 0 additions & 6 deletions drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion drivers/md/raid10.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit 71fe3fc

Please sign in to comment.