From: zhong jiang <zhongjiang@huawei.com>
To: Junhui Tang <tang.junhui.linux@gmail.com>
Cc: <colyli@suse.de>, Kent Overstreet <kent.overstreet@gmail.com>,
<linux-bcache@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] bcache: remove unnecessary null poiner check in cache_set_free
Date: Tue, 11 Sep 2018 09:36:59 +0800 [thread overview]
Message-ID: <5B971C3B.4070605@huawei.com> (raw)
In-Reply-To: <CA+NNRhEo-qryWzGoVbUtQVSbOhbTTwVuzAA7DYmTOcVN8oYehQ@mail.gmail.com>
On 2018/9/11 8:59, Junhui Tang wrote:
> This patch is NOT OK to me,maybe many cache in a cache_set, and some
> cache are not registered yet, so ca is possible NULL.
Yep, It's my fault. please ingnore the patch.
Thanks,
zhong jiang
> zhong jiang <zhongjiang@huawei.com> 于2018年9月8日周六 下午7:52写道:
>> The iterator in for_each_cache is never null, therefore, remove
>> the redundant null pointer check.
>>
>> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
>> ---
>> drivers/md/bcache/super.c | 11 +++++------
>> 1 file changed, 5 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
>> index 94c756c..2d26f9e 100644
>> --- a/drivers/md/bcache/super.c
>> +++ b/drivers/md/bcache/super.c
>> @@ -1513,12 +1513,11 @@ static void cache_set_free(struct closure *cl)
>> bch_btree_cache_free(c);
>> bch_journal_free(c);
>>
>> - for_each_cache(ca, c, i)
>> - if (ca) {
>> - ca->set = NULL;
>> - c->cache[ca->sb.nr_this_dev] = NULL;
>> - kobject_put(&ca->kobj);
>> - }
>> + for_each_cache(ca, c, i) {
>> + ca->set = NULL;
>> + c->cache[ca->sb.nr_this_dev] = NULL;
>> + kobject_put(&ca->kobj);
>> + }
>>
>> bch_bset_sort_state_free(&c->sort);
>> free_pages((unsigned long) c->uuids, ilog2(bucket_pages(c)));
>> --
>> 1.7.12.4
>>
>
prev parent reply other threads:[~2018-09-11 1:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-08 11:39 [PATCH] bcache: remove unnecessary null poiner check in cache_set_free zhong jiang
2018-09-11 0:59 ` Junhui Tang
2018-09-11 1:36 ` zhong jiang [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=5B971C3B.4070605@huawei.com \
--to=zhongjiang@huawei.com \
--cc=colyli@suse.de \
--cc=kent.overstreet@gmail.com \
--cc=linux-bcache@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tang.junhui.linux@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).