Linux ocfs2 filesystem development
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH] ocfs2:  free the mle while the res had one, to avoid mle memory leak.
@ 2016-09-13  7:52 Guozhonghua
  2016-09-13  8:56 ` Eric Ren
  2016-09-13 21:20 ` Andrew Morton
  0 siblings, 2 replies; 4+ messages in thread
From: Guozhonghua @ 2016-09-13  7:52 UTC (permalink / raw)
  To: ocfs2-devel

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


-------------------------------------------------------------------------------------------------------------------------------------
????????????????????????????????????????
????????????????????????????????????????
????????????????????????????????????????
???
This e-mail and its attachments contain confidential information from H3C, which is
intended only for the person or entity whose address is listed above. Any use of the
information contained herein in any way (including, but not limited to, total or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
by phone or email immediately and delete it!

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

end of thread, other threads:[~2016-09-14  1:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2016-09-14  1:37   ` Joseph Qi

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