Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165782
b: refs/heads/master
c: a11034b
h: refs/heads/master
v: v3
  • Loading branch information
Dan Williams committed Jul 14, 2009
1 parent 323fc46 commit 34c1f4e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 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: 04ce9ab385dc97eb55299d533cd3af79b8fc7529
refs/heads/master: a11034b4282515fd7d9f6fdc0a1380781da461c3
26 changes: 12 additions & 14 deletions trunk/drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -4309,6 +4309,15 @@ raid5_size(mddev_t *mddev, sector_t sectors, int raid_disks)
return sectors * (raid_disks - conf->max_degraded);
}

static void free_conf(raid5_conf_t *conf)
{
shrink_stripes(conf);
safe_put_page(conf->spare_page);
kfree(conf->disks);
kfree(conf->stripe_hashtbl);
kfree(conf);
}

static raid5_conf_t *setup_conf(mddev_t *mddev)
{
raid5_conf_t *conf;
Expand Down Expand Up @@ -4438,11 +4447,7 @@ static raid5_conf_t *setup_conf(mddev_t *mddev)

abort:
if (conf) {
shrink_stripes(conf);
safe_put_page(conf->spare_page);
kfree(conf->disks);
kfree(conf->stripe_hashtbl);
kfree(conf);
free_conf(conf);
return ERR_PTR(-EIO);
} else
return ERR_PTR(-ENOMEM);
Expand Down Expand Up @@ -4608,12 +4613,8 @@ static int run(mddev_t *mddev)
md_unregister_thread(mddev->thread);
mddev->thread = NULL;
if (conf) {
shrink_stripes(conf);
print_raid5_conf(conf);
safe_put_page(conf->spare_page);
kfree(conf->disks);
kfree(conf->stripe_hashtbl);
kfree(conf);
free_conf(conf);
}
mddev->private = NULL;
printk(KERN_ALERT "raid5: failed to run raid set %s\n", mdname(mddev));
Expand All @@ -4628,13 +4629,10 @@ static int stop(mddev_t *mddev)

md_unregister_thread(mddev->thread);
mddev->thread = NULL;
shrink_stripes(conf);
kfree(conf->stripe_hashtbl);
mddev->queue->backing_dev_info.congested_fn = NULL;
blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
sysfs_remove_group(&mddev->kobj, &raid5_attrs_group);
kfree(conf->disks);
kfree(conf);
free_conf(conf);
mddev->private = NULL;
return 0;
}
Expand Down

0 comments on commit 34c1f4e

Please sign in to comment.