mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wang Long <wanglong19@meituan.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: tytso@mit.edu, jack@suse.com, linux-ext4@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] jbd2: set to NULL after kmem_cache_destroy
Date: Tue, 6 Feb 2018 10:29:40 +0800	[thread overview]
Message-ID: <1fb20a12-8482-fea8-1db2-ff764216ea19@meituan.com> (raw)
In-Reply-To: <20180205170006.GA4838@magnolia>


On 6/2/2018 1:00 AM, Darrick J. Wong wrote:
> On Mon, Feb 05, 2018 at 09:39:17PM +0800, Wang Long wrote:
>> 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);
> kmem_cache_destroy already handles null pointers, so you can remove the
> conditional test entirely.
>
> --D
Thanks, I will send another patch to remove all conditional test in 
module JBD2.
>> -	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
>>

      reply	other threads:[~2018-02-06  2:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05 13:39 Wang Long
2018-02-05 17:00 ` Darrick J. Wong
2018-02-06  2:29   ` Wang Long [this message]

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=1fb20a12-8482-fea8-1db2-ff764216ea19@meituan.com \
    --to=wanglong19@meituan.com \
    --cc=darrick.wong@oracle.com \
    --cc=jack@suse.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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

all inboxes | Powered by JetHome®