lkml.org 
[lkml]   [2018]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] jbd2: set to NULL after kmem_cache_destroy
Date
Signed-off-by: Wang Long <wanglong19@meituan.com>
---
fs/jbd2/journal.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 93016bb..38dc24c 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -2649,11 +2649,14 @@ static int __init jbd2_journal_init_handle_cache(void)

static void jbd2_journal_destroy_handle_cache(void)
{
- if (jbd2_handle_cache)
+ if (jbd2_handle_cache) {
kmem_cache_destroy(jbd2_handle_cache);
- if (jbd2_inode_cache)
+ jbd2_handle_cache = NULL;
+ }
+ if (jbd2_inode_cache) {
kmem_cache_destroy(jbd2_inode_cache);
-
+ jbd2_inode_cache = NULL;
+ }
}

/*
--
1.8.3.1
\
 
 \ /
  Last update: 2018-02-05 17:45    [W:0.035 / U:13.408 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site