LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* drivers/md/raid10.c:995 wait_barrier() warn: if();
@ 2021-08-19  4:16 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2021-08-19  4:16 UTC (permalink / raw)
  To: Vitaly Mayatskikh; +Cc: kbuild-all, linux-kernel, Song Liu

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

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@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

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@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: 35993 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* drivers/md/raid10.c:995 wait_barrier() warn: if();
@ 2021-04-30 14:16 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2021-04-30 14:16 UTC (permalink / raw)
  To: Vitaly Mayatskikh; +Cc: kbuild-all, linux-kernel, Song Liu

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8ca5297e7e38f2dc8c753d33a5092e7be181fff0
commit: fe630de009d0729584d79c78f43121e07c745fdc md/raid10: avoid deadlock on recovery.
date:   9 months ago
config: nds32-randconfig-m031-20210430 (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

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@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: 20586 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* drivers/md/raid10.c:995 wait_barrier() warn: if();
@ 2021-02-07 12:35 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2021-02-07 12:35 UTC (permalink / raw)
  To: Vitaly Mayatskikh; +Cc: kbuild-all, linux-kernel, Song Liu

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-19  4:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19  4:16 drivers/md/raid10.c:995 wait_barrier() warn: if(); kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-04-30 14:16 kernel test robot
2021-02-07 12:35 kernel test robot

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).