Skip to contentSkip to conversation

raid5: add more checks before add sh->lru to plug cb list

PATCH RESEND Nick Desaulniers 1 participant 1 message Jan 6, 2020 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Apologies if it was already reported (working backwards through emails missed during the holidays), but this warning looks legit. Can you please take a look?

Quoted 86 lines · kbuild test robot

CC: kbuild-all(a)lists.01.org
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: jgq516(a)gmail.com
CC: liu.song.a23(a)gmail.com, linux-raid(a)vger.kernel.org, Guoqing Jiang <[email protected]>, linux-raid(a)vger.kernel.org, Guoqing Jiang <[email protected]>
CC: linux-raid(a)vger.kernel.org, Guoqing Jiang <[email protected]>

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.5-rc4 next-20191220]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/jgq516-gmail-com/raid5-add-more-checks-before-add-sh-lru-to-plug-cb-list/20200104-172752
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 3a562aee727a7bfbb3a37b1aa934118397dad701
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 10.0.0 (git://gitmirror/llvm_project 320b43c39f0eb636c84815ce463893b21befdc8f)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64

If you fix the issue, kindly add following tag

All warnings (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

drivers//md/raid5.c:5484:6: warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]

           if (!atomic_read(&sh->count) == 0 &&
               ^                        ~~
   drivers//md/raid5.c:5484:6: note: add parentheses after the '!' to evaluate the comparison first
           if (!atomic_read(&sh->count) == 0 &&
               ^
                (                           )
   drivers//md/raid5.c:5484:6: note: add parentheses around left hand side expression to silence this warning
           if (!atomic_read(&sh->count) == 0 &&
               ^
               (                       )

1 warning generated.

vim +5484 drivers//md/raid5.c

5461
5462 static void release_stripe_plug(struct mddev *mddev,
5463 struct stripe_head *sh)
5464 {
5465 struct blk_plug_cb *blk_cb = blk_check_plugged(
5466 raid5_unplug, mddev,
5467 sizeof(struct raid5_plug_cb));
5468 struct raid5_plug_cb *cb;
5469
5470 if (!blk_cb) {
5471 raid5_release_stripe(sh);
5472 return;
5473 }
5474
5475 cb = container_of(blk_cb, struct raid5_plug_cb, cb);
5476
5477 if (cb->list.next == NULL) {

  5478                  int i;
  5479                  INIT_LIST_HEAD(&cb->list);
  5480                  for (i = 0; i < NR_STRIPE_HASH_LOCKS; i++)

5481 INIT_LIST_HEAD(cb->temp_inactive_list + i);
5482 }
5483

Quoted 1 line

5484 if (!atomic_read(&sh->count) == 0 &&

5485 !test_bit(STRIPE_ON_RELEASE_LIST, &sh->state) &&
5486 !test_and_set_bit(STRIPE_ON_UNPLUG_LIST, &sh->state))
5487 list_add_tail(&sh->lru, &cb->list);
5488 else
5489 raid5_release_stripe(sh);
5490 }
5491

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

--
You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe(a)googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/202001050333.SnzanhNo%25lkp%40intel.com.

Signature · 2 lines
Thanks,
~Nick Desaulniers