md: raid1/raid10 md devices leak memory when stopping
authorHirokazu Takahashi <taka@valinux.co.jp>
Wed, 24 Apr 2013 01:42:44 +0000 (11:42 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 30 Apr 2013 04:49:26 +0000 (14:49 +1000)
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>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid1.c
drivers/md/raid10.c

index fd86b37..c055b92 100644 (file)
@@ -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;
index 2372926..c35d912 100644 (file)
@@ -3826,6 +3826,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;