public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Vitaly Mayatskikh <vmayatskikh@digitalocean.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Song Liu <songliubraving@fb.com>
Subject: drivers/md/raid10.c:995 wait_barrier() warn: if();
Date: Sun, 7 Feb 2021 20:35:46 +0800	[thread overview]
Message-ID: <202102072038.Lp0eD8Rc-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4573 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   61556703b610a104de324e4f061dc6cf7b218b46
commit: fe630de009d0729584d79c78f43121e07c745fdc md/raid10: avoid deadlock on recovery.
date:   7 months ago
config: nds32-randconfig-m031-20210207 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

New smatch warnings:
drivers/md/raid10.c:995 wait_barrier() warn: if();
drivers/md/raid10.c:995 wait_barrier() warn: if();
drivers/md/raid10.c:995 wait_barrier() warn: ignoring unreachable code.

Old smatch warnings:
drivers/md/raid10.c:3220 raid10_sync_request() error: we previously assumed 'bio' could be null (see line 3212)
drivers/md/raid10.c:3225 raid10_sync_request() error: we previously assumed 'mreplace' could be null (see line 3111)
drivers/md/raid10.c:3575 calc_sectors() warn: should '1 << conf->geo.chunk_shift' be a 64 bit type?

vim +995 drivers/md/raid10.c

0a27ec96b6fb1ab NeilBrown         2006-01-06   978  
e879a8793f915aa NeilBrown         2011-10-11   979  static void wait_barrier(struct r10conf *conf)
0a27ec96b6fb1ab NeilBrown         2006-01-06   980  {
0a27ec96b6fb1ab NeilBrown         2006-01-06   981  	spin_lock_irq(&conf->resync_lock);
0a27ec96b6fb1ab NeilBrown         2006-01-06   982  	if (conf->barrier) {
fe630de009d0729 Vitaly Mayatskikh 2020-03-03   983  		struct bio_list *bio_list = current->bio_list;
0a27ec96b6fb1ab NeilBrown         2006-01-06   984  		conf->nr_waiting++;
d6b42dcb995e6ac NeilBrown         2012-03-19   985  		/* Wait for the barrier to drop.
d6b42dcb995e6ac NeilBrown         2012-03-19   986  		 * However if there are already pending
d6b42dcb995e6ac NeilBrown         2012-03-19   987  		 * requests (preventing the barrier from
d6b42dcb995e6ac NeilBrown         2012-03-19   988  		 * rising completely), and the
d6b42dcb995e6ac NeilBrown         2012-03-19   989  		 * pre-process bio queue isn't empty,
d6b42dcb995e6ac NeilBrown         2012-03-19   990  		 * then don't wait, as we need to empty
d6b42dcb995e6ac NeilBrown         2012-03-19   991  		 * that queue to get the nr_pending
d6b42dcb995e6ac NeilBrown         2012-03-19   992  		 * count down.
d6b42dcb995e6ac NeilBrown         2012-03-19   993  		 */
578b54ade8a5e04 NeilBrown         2016-11-14   994  		raid10_log(conf->mddev, "wait barrier");
d6b42dcb995e6ac NeilBrown         2012-03-19  @995  		wait_event_lock_irq(conf->wait_barrier,
d6b42dcb995e6ac NeilBrown         2012-03-19   996  				    !conf->barrier ||
0e5313e2d4ef93b Tomasz Majchrzak  2016-06-24   997  				    (atomic_read(&conf->nr_pending) &&
fe630de009d0729 Vitaly Mayatskikh 2020-03-03   998  				     bio_list &&
fe630de009d0729 Vitaly Mayatskikh 2020-03-03   999  				     (!bio_list_empty(&bio_list[0]) ||
fe630de009d0729 Vitaly Mayatskikh 2020-03-03  1000  				      !bio_list_empty(&bio_list[1]))) ||
fe630de009d0729 Vitaly Mayatskikh 2020-03-03  1001  				     /* move on if recovery thread is
fe630de009d0729 Vitaly Mayatskikh 2020-03-03  1002  				      * blocked by us
fe630de009d0729 Vitaly Mayatskikh 2020-03-03  1003  				      */
fe630de009d0729 Vitaly Mayatskikh 2020-03-03  1004  				     (conf->mddev->thread->tsk == current &&
fe630de009d0729 Vitaly Mayatskikh 2020-03-03  1005  				      test_bit(MD_RECOVERY_RUNNING,
fe630de009d0729 Vitaly Mayatskikh 2020-03-03  1006  					       &conf->mddev->recovery) &&
fe630de009d0729 Vitaly Mayatskikh 2020-03-03  1007  				      conf->nr_queued > 0),
eed8c02e680c04c Lukas Czerner     2012-11-30  1008  				    conf->resync_lock);
0a27ec96b6fb1ab NeilBrown         2006-01-06  1009  		conf->nr_waiting--;
0e5313e2d4ef93b Tomasz Majchrzak  2016-06-24  1010  		if (!conf->nr_waiting)
0e5313e2d4ef93b Tomasz Majchrzak  2016-06-24  1011  			wake_up(&conf->wait_barrier);
0a27ec96b6fb1ab NeilBrown         2006-01-06  1012  	}
0e5313e2d4ef93b Tomasz Majchrzak  2016-06-24  1013  	atomic_inc(&conf->nr_pending);
^1da177e4c3f415 Linus Torvalds    2005-04-16  1014  	spin_unlock_irq(&conf->resync_lock);
^1da177e4c3f415 Linus Torvalds    2005-04-16  1015  }
^1da177e4c3f415 Linus Torvalds    2005-04-16  1016  

:::::: The code at line 995 was first introduced by commit
:::::: d6b42dcb995e6acd7cc276774e751ffc9f0ef4bf md/raid1,raid10: avoid deadlock during resync/recovery.

:::::: TO: NeilBrown <neilb@suse.de>
:::::: CC: NeilBrown <neilb@suse.de>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 21182 bytes --]

             reply	other threads:[~2021-02-07 12:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-07 12:35 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-04-30 14:16 drivers/md/raid10.c:995 wait_barrier() warn: if(); kernel test robot
2021-08-19  4:16 kernel test robot

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=202102072038.Lp0eD8Rc-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=vmayatskikh@digitalocean.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