Linux RAID subsystem development
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: linux-raid@vger.kernel.org
Subject: Re: [BUG][PATCH] Fix: raid1/raid10 md devices leak memory when stopping
Date: Mon, 22 Apr 2013 10:29:18 +1000	[thread overview]
Message-ID: <20130422102918.7e9df194@notabene.brown> (raw)
In-Reply-To: <20130416.201507.1380418477042006122.taka@valinux.co.jp>

[-- Attachment #1: Type: text/plain, Size: 1326 bytes --]

On Tue, 16 Apr 2013 20:15:07 +0900 (JST) Hirokazu Takahashi
<taka@valinux.co.jp> wrote:

> 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;

Thanks for the patch!
I've queued it for 3.10-rc

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

      reply	other threads:[~2013-04-22  0:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130422102918.7e9df194@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=taka@valinux.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox