Linux RAID subsystem development
 help / color / mirror / Atom feed
* [BUG][PATCH] Fix: raid1/raid10 md devices leak memory when stopping
@ 2013-04-16 11:15 Hirokazu Takahashi
  2013-04-22  0:29 ` NeilBrown
  0 siblings, 1 reply; 2+ messages in thread
From: Hirokazu Takahashi @ 2013-04-16 11:15 UTC (permalink / raw)
  To: linux-raid

Hi.

Raid1 and raid10 devices leak memory every time they stop.
This is a patch for linux-3.9.0-rc7 to fix this problem.

Thanks,
Hirokazu Takahashi.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
---
 drivers/md/raid1.c  |    1 +
 drivers/md/raid10.c |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index fd86b37..c055b92 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -2901,6 +2901,7 @@ static int stop(struct mddev *mddev)
 	if (conf->r1bio_pool)
 		mempool_destroy(conf->r1bio_pool);
 	kfree(conf->mirrors);
+	safe_put_page(conf->tmppage);
 	kfree(conf->poolinfo);
 	kfree(conf);
 	mddev->private = NULL;
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 77b562d..5a1010d 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -3810,6 +3810,7 @@ static int stop(struct mddev *mddev)
 
 	if (conf->r10bio_pool)
 		mempool_destroy(conf->r10bio_pool);
+	safe_put_page(conf->tmppage);
 	kfree(conf->mirrors);
 	kfree(conf);
 	mddev->private = NULL;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-22  0:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-16 11:15 [BUG][PATCH] Fix: raid1/raid10 md devices leak memory when stopping Hirokazu Takahashi
2013-04-22  0:29 ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox