The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] scsi: Do not break scan luns loop if add single lun failed
@ 2021-12-25 23:29 Wenchao Hao
  2021-12-30 17:55 ` Steffen Maier
  2022-01-12  2:28 ` Wenchao Hao
  0 siblings, 2 replies; 4+ messages in thread
From: Wenchao Hao @ 2021-12-25 23:29 UTC (permalink / raw)
  To: James E . J . Bottomley, Martin K . Petersen, linux-scsi,
	linux-kernel
  Cc: Zhiqiang Liu, Feilong Lin, Wu Bo, Wenchao Hao

Failed to add a single lun does not mean all luns are unaccessible,
if we break the scan luns loop, the other luns reported by REPORT LUNS
command would not be probed any more.

In this case, we might loss some luns which are accessible.

Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
---
 drivers/scsi/scsi_scan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 23e1c0acdeae..fee7ce082103 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -1476,13 +1476,13 @@ static int scsi_report_lun_scan(struct scsi_target *starget, blist_flags_t bflag
 				lun, NULL, NULL, rescan, NULL);
 			if (res == SCSI_SCAN_NO_RESPONSE) {
 				/*
-				 * Got some results, but now none, abort.
+				 * Got some results, but now none, abort this lun
 				 */
 				sdev_printk(KERN_ERR, sdev,
 					"Unexpected response"
 					" from lun %llu while scanning, scan"
 					" aborted\n", (unsigned long long)lun);
-				break;
+				continue;
 			}
 		}
 	}
-- 
2.32.0


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

end of thread, other threads:[~2022-01-12  2:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-25 23:29 [PATCH] scsi: Do not break scan luns loop if add single lun failed Wenchao Hao
2021-12-30 17:55 ` Steffen Maier
2022-01-04 12:10   ` Wenchao Hao
2022-01-12  2:28 ` Wenchao Hao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox