diff options
author | Joseph Qi <joseph.qi@huawei.com> | 2014-05-22 14:54:22 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-05-23 12:37:30 -0400 |
commit | 66db6cfd49825f4e3462ceee3bcbb292d57da6fb (patch) | |
tree | e1082bd92e171d338034f2ea31ef992f4ed7c331 /fs/ocfs2 | |
parent | 3e030ecc0fc7de10fd0da10c1c19939872a31717 (diff) |
ocfs2: fix double kmem_cache_destroy in dlm_init
In dlm_init, if create dlm_lockname_cache failed in
dlm_init_master_caches, it will destroy dlm_lockres_cache which created
before twice. And this will cause system die when loading modules.
Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/dlm/dlmmaster.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c index af3f7aa73e13..ee1f88419cb0 100644 --- a/fs/ocfs2/dlm/dlmmaster.c +++ b/fs/ocfs2/dlm/dlmmaster.c | |||
@@ -472,11 +472,15 @@ bail: | |||
472 | 472 | ||
473 | void dlm_destroy_master_caches(void) | 473 | void dlm_destroy_master_caches(void) |
474 | { | 474 | { |
475 | if (dlm_lockname_cache) | 475 | if (dlm_lockname_cache) { |
476 | kmem_cache_destroy(dlm_lockname_cache); | 476 | kmem_cache_destroy(dlm_lockname_cache); |
477 | dlm_lockname_cache = NULL; | ||
478 | } | ||
477 | 479 | ||
478 | if (dlm_lockres_cache) | 480 | if (dlm_lockres_cache) { |
479 | kmem_cache_destroy(dlm_lockres_cache); | 481 | kmem_cache_destroy(dlm_lockres_cache); |
482 | dlm_lockres_cache = NULL; | ||
483 | } | ||
480 | } | 484 | } |
481 | 485 | ||
482 | static void dlm_lockres_release(struct kref *kref) | 486 | static void dlm_lockres_release(struct kref *kref) |