aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-07-30 22:39:15 -0400
committerNeilBrown <neilb@suse.de>2009-07-30 22:39:15 -0400
commit95fc17aac45300f45968aacd97a536ddd8db8101 (patch)
tree9ca3004304165a17c2923f25ee1df196928ce858 /drivers/md
parent7d3e91b8a1f5179d56a7412d4b499f2d5fc6b25d (diff)
md/raid6: release spare page at ->stop()
Add missing call to safe_put_page from stop() by unifying open coded raid5_conf_t de-allocation under free_conf(). Cc: <stable@kernel.org> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/raid5.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 37835538b58e..39374230a463 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -4316,6 +4316,15 @@ raid5_size(mddev_t *mddev, sector_t sectors, int raid_disks)
4316 return sectors * (raid_disks - conf->max_degraded); 4316 return sectors * (raid_disks - conf->max_degraded);
4317} 4317}
4318 4318
4319static void free_conf(raid5_conf_t *conf)
4320{
4321 shrink_stripes(conf);
4322 safe_put_page(conf->spare_page);
4323 kfree(conf->disks);
4324 kfree(conf->stripe_hashtbl);
4325 kfree(conf);
4326}
4327
4319static raid5_conf_t *setup_conf(mddev_t *mddev) 4328static raid5_conf_t *setup_conf(mddev_t *mddev)
4320{ 4329{
4321 raid5_conf_t *conf; 4330 raid5_conf_t *conf;
@@ -4447,11 +4456,7 @@ static raid5_conf_t *setup_conf(mddev_t *mddev)
4447 4456
4448 abort: 4457 abort:
4449 if (conf) { 4458 if (conf) {
4450 shrink_stripes(conf); 4459 free_conf(conf);
4451 safe_put_page(conf->spare_page);
4452 kfree(conf->disks);
4453 kfree(conf->stripe_hashtbl);
4454 kfree(conf);
4455 return ERR_PTR(-EIO); 4460 return ERR_PTR(-EIO);
4456 } else 4461 } else
4457 return ERR_PTR(-ENOMEM); 4462 return ERR_PTR(-ENOMEM);
@@ -4629,12 +4634,8 @@ abort:
4629 md_unregister_thread(mddev->thread); 4634 md_unregister_thread(mddev->thread);
4630 mddev->thread = NULL; 4635 mddev->thread = NULL;
4631 if (conf) { 4636 if (conf) {
4632 shrink_stripes(conf);
4633 print_raid5_conf(conf); 4637 print_raid5_conf(conf);
4634 safe_put_page(conf->spare_page); 4638 free_conf(conf);
4635 kfree(conf->disks);
4636 kfree(conf->stripe_hashtbl);
4637 kfree(conf);
4638 } 4639 }
4639 mddev->private = NULL; 4640 mddev->private = NULL;
4640 printk(KERN_ALERT "raid5: failed to run raid set %s\n", mdname(mddev)); 4641 printk(KERN_ALERT "raid5: failed to run raid set %s\n", mdname(mddev));
@@ -4649,13 +4650,10 @@ static int stop(mddev_t *mddev)
4649 4650
4650 md_unregister_thread(mddev->thread); 4651 md_unregister_thread(mddev->thread);
4651 mddev->thread = NULL; 4652 mddev->thread = NULL;
4652 shrink_stripes(conf);
4653 kfree(conf->stripe_hashtbl);
4654 mddev->queue->backing_dev_info.congested_fn = NULL; 4653 mddev->queue->backing_dev_info.congested_fn = NULL;
4655 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/ 4654 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
4656 sysfs_remove_group(&mddev->kobj, &raid5_attrs_group); 4655 sysfs_remove_group(&mddev->kobj, &raid5_attrs_group);
4657 kfree(conf->disks); 4656 free_conf(conf);
4658 kfree(conf);
4659 mddev->private = NULL; 4657 mddev->private = NULL;
4660 return 0; 4658 return 0;
4661} 4659}