CC: [email protected]
TO: "Hannes, Reinecke," <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git 
xarray.v4
head:   4196b2277d94baee7703987a4a6b9c30214e0da7
commit: 89cdad03f4ab20b9b6789eff881cb57c4f83bfd6 [1/6] scsi: convert target 
lookup to xarray
:::::: branch date: 34 hours ago
:::::: commit date: 34 hours ago
config: i386-randconfig-m021-20200603 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

New smatch warnings:
drivers/scsi/scsi_sysfs.c:1542 scsi_remove_target() error: double unlocked 
'*shost->host_lock' (orig line 1535)

Old smatch warnings:
drivers/scsi/scsi_sysfs.c:349 store_shost_eh_deadline() warn: impossible 
condition '(deadline * 1000 > (~0)) => (0-u32max > u32max)'

# 
https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git/commit/?id=89cdad03f4ab20b9b6789eff881cb57c4f83bfd6
git remote add hare-scsi-devel 
https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git
git remote update hare-scsi-devel
git checkout 89cdad03f4ab20b9b6789eff881cb57c4f83bfd6
vim +1542 drivers/scsi/scsi_sysfs.c

20b1e674230b642 Patrick Mochel     2005-03-24  1502  
^1da177e4c3f415 Linus Torvalds     2005-04-16  1503  /**
^1da177e4c3f415 Linus Torvalds     2005-04-16  1504   * scsi_remove_target - 
try to remove a target and all its devices
^1da177e4c3f415 Linus Torvalds     2005-04-16  1505   * @dev: generic starget 
or parent of generic stargets to be removed
^1da177e4c3f415 Linus Torvalds     2005-04-16  1506   *
^1da177e4c3f415 Linus Torvalds     2005-04-16  1507   * Note: This is slightly 
racy.  It is possible that if the user
^1da177e4c3f415 Linus Torvalds     2005-04-16  1508   * requests the addition 
of another device then the target won't be
^1da177e4c3f415 Linus Torvalds     2005-04-16  1509   * removed.
^1da177e4c3f415 Linus Torvalds     2005-04-16  1510   */
^1da177e4c3f415 Linus Torvalds     2005-04-16  1511  void 
scsi_remove_target(struct device *dev)
^1da177e4c3f415 Linus Torvalds     2005-04-16  1512  {
3b661a92e869ebe Dan Williams       2012-06-21  1513     struct Scsi_Host *shost 
= dev_to_shost(dev->parent);
89cdad03f4ab20b Hannes Reinecke    2020-05-27  1514     struct scsi_target 
*starget, *starget_next;
89cdad03f4ab20b Hannes Reinecke    2020-05-27  1515     unsigned long tid = 0;
3b661a92e869ebe Dan Williams       2012-06-21  1516     unsigned long flags;
3b661a92e869ebe Dan Williams       2012-06-21  1517  
3b661a92e869ebe Dan Williams       2012-06-21  1518     
spin_lock_irqsave(shost->host_lock, flags);
89cdad03f4ab20b Hannes Reinecke    2020-05-27  1519     starget = 
xa_find(&shost->__targets, &tid, UINT_MAX, XA_PRESENT);
89cdad03f4ab20b Hannes Reinecke    2020-05-27  1520     while (starget) {
89cdad03f4ab20b Hannes Reinecke    2020-05-27  1521             starget_next = 
xa_find_after(&shost->__targets, &tid,
89cdad03f4ab20b Hannes Reinecke    2020-05-27  1522                             
             UINT_MAX, XA_PRESENT);
90a88d6ef88edcf James Bottomley    2016-02-10  1523             if 
(starget->state == STARGET_DEL ||
f9279c968c257ee Ewan D. Milne      2017-06-27  1524                 
starget->state == STARGET_REMOVE ||
89cdad03f4ab20b Hannes Reinecke    2020-05-27  1525                 
starget->state == STARGET_CREATED_REMOVE) {
89cdad03f4ab20b Hannes Reinecke    2020-05-27  1526                     starget 
= starget_next;
3b661a92e869ebe Dan Williams       2012-06-21  1527                     
continue;
89cdad03f4ab20b Hannes Reinecke    2020-05-27  1528             }
3b661a92e869ebe Dan Williams       2012-06-21  1529             if 
(starget->dev.parent == dev || &starget->dev == dev) {
e63ed0d7a98014f James Bottomley    2014-01-21  1530                     
kref_get(&starget->reap_ref);
f9279c968c257ee Ewan D. Milne      2017-06-27  1531                     if 
(starget->state == STARGET_CREATED)
f9279c968c257ee Ewan D. Milne      2017-06-27  1532                             
starget->state = STARGET_CREATED_REMOVE;
f9279c968c257ee Ewan D. Milne      2017-06-27  1533                     else
f05795d3d771f30 Johannes Thumshirn 2016-04-05  1534                             
starget->state = STARGET_REMOVE;
bc3f02a795d3b4f Dan Williams       2012-08-28 @1535                     
spin_unlock_irqrestore(shost->host_lock, flags);
bc3f02a795d3b4f Dan Williams       2012-08-28  1536                     
__scsi_remove_target(starget);
40998193560dab6 Christoph Hellwig  2015-10-19  1537                     
scsi_target_reap(starget);
89cdad03f4ab20b Hannes Reinecke    2020-05-27  1538                     
spin_lock_irqsave(shost->host_lock, flags);
3b661a92e869ebe Dan Williams       2012-06-21  1539             }
89cdad03f4ab20b Hannes Reinecke    2020-05-27  1540             starget = 
starget_next;
^1da177e4c3f415 Linus Torvalds     2005-04-16  1541     }
3b661a92e869ebe Dan Williams       2012-06-21 @1542     
spin_unlock_irqrestore(shost->host_lock, flags);
^1da177e4c3f415 Linus Torvalds     2005-04-16  1543  }
^1da177e4c3f415 Linus Torvalds     2005-04-16  1544  
EXPORT_SYMBOL(scsi_remove_target);
^1da177e4c3f415 Linus Torvalds     2005-04-16  1545  

:::::: The code at line 1542 was first introduced by commit
:::::: 3b661a92e869ebe2358de8f4b3230ad84f7fce51 [SCSI] fix hot unplug vs async 
scan race

:::::: TO: Dan Williams <[email protected]>
:::::: CC: James Bottomley <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to