Skip to content

Commit

Permalink
ocfs2: fix double kmem_cache_destroy in dlm_init
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Mark Fasheh <[email protected]>
Cc: Joel Becker <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
josephhz authored and torvalds committed May 23, 2014
1 parent 3e030ec commit 66db6cf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions fs/ocfs2/dlm/dlmmaster.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,15 @@ int dlm_init_master_caches(void)

void dlm_destroy_master_caches(void)
{
if (dlm_lockname_cache)
if (dlm_lockname_cache) {
kmem_cache_destroy(dlm_lockname_cache);
dlm_lockname_cache = NULL;
}

if (dlm_lockres_cache)
if (dlm_lockres_cache) {
kmem_cache_destroy(dlm_lockres_cache);
dlm_lockres_cache = NULL;
}
}

static void dlm_lockres_release(struct kref *kref)
Expand Down

0 comments on commit 66db6cf

Please sign in to comment.