Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24408
b: refs/heads/master
c: b55e6bf
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Mar 27, 2006
1 parent b557efd commit 8d86581
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4588b42e9d0d0904a745c96cead66506c75bae21
refs/heads/master: b55e6bfcd23cb2f7249095050c649f7aea813f9f
10 changes: 7 additions & 3 deletions trunk/drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -1822,11 +1822,13 @@ static int run(mddev_t *mddev)
return -EIO;
}

mddev->private = kzalloc(sizeof (raid5_conf_t)
+ mddev->raid_disks * sizeof(struct disk_info),
GFP_KERNEL);
mddev->private = kzalloc(sizeof (raid5_conf_t), GFP_KERNEL);
if ((conf = mddev->private) == NULL)
goto abort;
conf->disks = kzalloc(mddev->raid_disks * sizeof(struct disk_info),
GFP_KERNEL);
if (!conf->disks)
goto abort;

conf->mddev = mddev;

Expand Down Expand Up @@ -1966,6 +1968,7 @@ static int run(mddev_t *mddev)
abort:
if (conf) {
print_raid5_conf(conf);
kfree(conf->disks);
kfree(conf->stripe_hashtbl);
kfree(conf);
}
Expand All @@ -1986,6 +1989,7 @@ static int stop(mddev_t *mddev)
kfree(conf->stripe_hashtbl);
blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
sysfs_remove_group(&mddev->kobj, &raid5_attrs_group);
kfree(conf->disks);
kfree(conf);
mddev->private = NULL;
return 0;
Expand Down
10 changes: 7 additions & 3 deletions trunk/drivers/md/raid6main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2006,11 +2006,14 @@ static int run(mddev_t *mddev)
return -EIO;
}

mddev->private = kzalloc(sizeof (raid6_conf_t)
+ mddev->raid_disks * sizeof(struct disk_info),
GFP_KERNEL);
mddev->private = kzalloc(sizeof (raid6_conf_t), GFP_KERNEL);
if ((conf = mddev->private) == NULL)
goto abort;
conf->disks = kzalloc(mddev->raid_disks * sizeof(struct disk_info),
GFP_KERNEL);
if (!conf->disks)
goto abort;

conf->mddev = mddev;

if ((conf->stripe_hashtbl = kzalloc(PAGE_SIZE, GFP_KERNEL)) == NULL)
Expand Down Expand Up @@ -2158,6 +2161,7 @@ static int run(mddev_t *mddev)
print_raid6_conf(conf);
safe_put_page(conf->spare_page);
kfree(conf->stripe_hashtbl);
kfree(conf->disks);
kfree(conf);
}
mddev->private = NULL;
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/raid/raid5.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ struct raid5_private_data {
* waiting for 25% to be free
*/
spinlock_t device_lock;
struct disk_info disks[0];
struct disk_info *disks;
};

typedef struct raid5_private_data raid5_conf_t;
Expand Down

0 comments on commit 8d86581

Please sign in to comment.