From: Andrew Morton <akpm@linux-foundation.org>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: free the mle while the res had one, to avoid mle memory leak.
Date: Tue, 13 Sep 2016 14:20:12 -0700 [thread overview]
Message-ID: <20160913142012.2e2b071e1923e8fef6182274@linux-foundation.org> (raw)
In-Reply-To: <71604351584F6A4EBAE558C676F37CA4A3D3522A@H3CMLB12-EX.srv.huawei-3com.com>
On Tue, 13 Sep 2016 07:52:30 +0000 Guozhonghua <guozhonghua@h3c.com> wrote:
> In the function dlm_migrate_request_handler, while the ret is --EEXIST, the mle should be freed, otherwise the memory will be leaked.
>
> Signed-off-by: Guozhonghua <guozhonghua@h3c.com>
>
> --- ocfs2.orig/dlm/dlmmaster.c 2016-09-13 15:18:13.602684325 +0800
> +++ ocfs2/dlm/dlmmaster.c 2016-09-13 15:27:05.014675736 +0800
> @@ -3188,6 +3188,9 @@ int dlm_migrate_request_handler(struct o
> migrate->new_master,
> migrate->master);
>
> + if (ret < 0)
> + kmem_cache_free(dlm_mle_cache, mle);
> +
> spin_unlock(&dlm->master_lock);
> unlock:
> spin_unlock(&dlm->spinlock);
Looks OK to me.
I wonder if there's another bug here. If dlm_add_migration_mle()
failed, is it correct to go ahead and detach `oldmle'?
next prev parent reply other threads:[~2016-09-13 21:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-13 7:52 [Ocfs2-devel] [PATCH] ocfs2: free the mle while the res had one, to avoid mle memory leak Guozhonghua
2016-09-13 8:56 ` Eric Ren
2016-09-13 21:20 ` Andrew Morton [this message]
2016-09-14 1:37 ` Joseph Qi
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=20160913142012.2e2b071e1923e8fef6182274@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=ocfs2-devel@oss.oracle.com \
/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