Skip to contentSkip to conversation

scsi: Add numbers of lun for scan debug log

PATCH New Wu Bo 1 participant 1 message Mar 17, 2021 SCSI

lore
Share & tools
lore

Wu Bo

author
#0 lore raw

PATCH 1/1 scsi: Add numbers of lun for scan debug log

Sometimes, want to know the number of LUN in the REPORT LUN or sequential scan LUN. Adding the numbers of LUN is convenient for debugging.

---
 drivers/scsi/scsi_scan.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/scsi/scsi_scan.c +3 -4
index 9af50e6..ea679d7 100644
@@ -1201,9 +1201,6 @@ static void scsi_sequential_lun_scan(struct scsi_target *starget,
 	u64 sparse_lun, lun;
 	struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
 
-	SCSI_LOG_SCAN_BUS(3, starget_printk(KERN_INFO, starget,
-		"scsi scan: Sequential scan\n"));
-
 	max_dev_lun = min(max_scsi_luns, shost->max_lun);
 	/*
 	 * If this device is known to support sparse multiple units,
@@ -1253,6 +1250,8 @@ static void scsi_sequential_lun_scan(struct scsi_target *starget,
 	else
 		max_dev_lun = min(256U, max_dev_lun);
 
+	SCSI_LOG_SCAN_BUS(3, starget_printk(KERN_INFO, starget,
+		"scsi scan: Sequential scan, max LUNs:%u\n", max_dev_lun));
 	/*
 	 * We have already scanned LUN 0, so start at LUN 1. Keep scanning
 	 * until we reach the max, or no LUN is found and we are not
@@ -1413,7 +1412,7 @@ static int scsi_report_lun_scan(struct scsi_target *starget, blist_flags_t bflag
 	num_luns = (length / sizeof(struct scsi_lun));
 
 	SCSI_LOG_SCAN_BUS(3, sdev_printk (KERN_INFO, sdev,
-		"scsi scan: REPORT LUN scan\n"));
+		"scsi scan: REPORT LUN scan, total LUNs%u\n", num_luns));
 
 	/*
 	 * Scan the luns in lun_data. The entry at offset 0 is really
Signature · 1 line
1.8.3.1