lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202108191207.lyztgSUm-lkp@intel.com>
Date:   Thu, 19 Aug 2021 12:16:21 +0800
From:   kernel test robot <lkp@...el.com>
To:     Vitaly Mayatskikh <vmayatskikh@...italocean.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Song Liu <songliubraving@...com>
Subject: drivers/md/raid10.c:995 wait_barrier() warn: if();

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d6d09a6942050f21b065a134169002b4d6b701ef
commit: fe630de009d0729584d79c78f43121e07c745fdc md/raid10: avoid deadlock on recovery.
date:   1 year, 1 month ago
config: nds32-randconfig-m031-20210818 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.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

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

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

Download attachment ".config.gz" of type "application/gzip" (35993 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ