Skip to contentSkip to conversation

scsi: storvsc: Don't report the host packet status as the hv status

PATCH Applied Roman Kisel 4 participants 6 messages Mar 4, 2025 – Mar 18, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover scsi: storvsc: Don't report the host packet status as the hv status

The patch includes fixes for the log statements that are ambigious as to what they are logging.

Michael Kelley provided a great insight into the history of the code (** Thank you, Michael! **) and tagged the V1 patch with "Reviewed-by". I am not keeping the tag as a I added one more change to convert the status code to hex in addition to what was approved.

[V2]
- Use "host" instead of opaque "sts".
** Thank you, Easwar! **

- Convert the status to hex everywhere.

[V1]: https://lore.kernel.org/linux-hyperv/[email protected]/

Roman Kisel (1):
scsi: storvsc: Don't report the host packet status as the hv status

 drivers/scsi/storvsc_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

base-commit: 3a7f7785eae7cf012af128ca9e383c91e4955354

Signature · 1 line
2.43.0
#1 lore raw

PATCH v2 1/1 scsi: storvsc: Don't report the host packet status as the hv status

The log statement reports the packet status code as the hv status code which causes confusion when debugging as "hv" might refer to a hypervisor, and sometimes to the host part of the Hyper-V virtualization stack.

Fix the name of the datum being logged to clearly indicate the component reporting the error. Also log it in hexadecimal everywhere for consistency.

---
 drivers/scsi/storvsc_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/storvsc_drv.c +2 -2
index a8614e54544e..35db061ae3ec 100644
@@ -776,7 +776,7 @@ static void  handle_multichannel_storage(struct hv_device *device, int max_chns)
 
 	if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
 	    vstor_packet->status != 0) {
-		dev_err(dev, "Failed to create sub-channel: op=%d, sts=%d\n",
+		dev_err(dev, "Failed to create sub-channel: op=%d, host=0x%x\n",
 			vstor_packet->operation, vstor_packet->status);
 		return;
 	}
@@ -1183,7 +1183,7 @@ static void storvsc_on_io_completion(struct storvsc_device *stor_device,
 			STORVSC_LOGGING_WARN : STORVSC_LOGGING_ERROR;
 
 		storvsc_log_ratelimited(device, loglevel,
-			"tag#%d cmd 0x%x status: scsi 0x%x srb 0x%x hv 0x%x\n",
+			"tag#%d cmd 0x%x status: scsi 0x%x srb 0x%x host 0x%x\n",
 			scsi_cmd_to_rq(request->cmd)->tag,
 			stor_pkt->vm_srb.cdb[0],
 			vstor_packet->vm_srb.scsi_status,
Signature · 1 line
2.43.0
Reviewed-by on v2 1/1
#2 lore raw
Quoted 28 lines · Roman Kisel

The log statement reports the packet status code as the hv status code which causes confusion when debugging as "hv" might refer to a hypervisor, and sometimes to the host part of the Hyper-V virtualization stack.

Fix the name of the datum being logged to clearly indicate the component reporting the error. Also log it in hexadecimal everywhere for consistency.

---
 drivers/scsi/storvsc_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/storvsc_drv.c +1 -1
index a8614e54544e..35db061ae3ec 100644
@@ -776,7 +776,7 @@ static void  handle_multichannel_storage(struct hv_device *device, int max_chns)
 
 	if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
 	    vstor_packet->status != 0) {
-		dev_err(dev, "Failed to create sub-channel: op=%d, sts=%d\n",
+		dev_err(dev, "Failed to create sub-channel: op=%d, host=0x%x\n",
 			vstor_packet->operation, vstor_packet->status);
 		return;
 	}

drivers/scsi/storvsc_drv.c static void storvsc_on_io_completion(struct storvsc_device *stor_device, · line 1189

Quoted 8 lines
drivers/scsi/storvsc_drv.c +1 -1
@@ -1183,7 +1183,7 @@ static void storvsc_on_io_completion(struct storvsc_device *stor_device,
 			STORVSC_LOGGING_WARN : STORVSC_LOGGING_ERROR;
 
 		storvsc_log_ratelimited(device, loglevel,
-			"tag#%d cmd 0x%x status: scsi 0x%x srb 0x%x hv 0x%x\n",
+			"tag#%d cmd 0x%x status: scsi 0x%x srb 0x%x host 0x%x\n",
 			scsi_cmd_to_rq(request->cmd)->tag,
 			stor_pkt->vm_srb.cdb[0],
 			vstor_packet->vm_srb.scsi_status,

Looks good to me.

Reviewed-by on v2 1/1
#3 lore raw
In reply to Roman Kisel

From: Roman Kisel <[email protected]> Sent: Monday, March 3, 2025 4:10 PM

Quoted 29 lines

The log statement reports the packet status code as the hv status code which causes confusion when debugging as "hv" might refer to a hypervisor, and sometimes to the host part of the Hyper-V virtualization stack.

Fix the name of the datum being logged to clearly indicate the component reporting the error. Also log it in hexadecimal everywhere for consistency.

---
 drivers/scsi/storvsc_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/storvsc_drv.c +1 -1
index a8614e54544e..35db061ae3ec 100644
@@ -776,7 +776,7 @@ static void  handle_multichannel_storage(struct hv_device *device, int max_chns)
 
 	if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
 	    vstor_packet->status != 0) {
-		dev_err(dev, "Failed to create sub-channel: op=%d, sts=%d\n",
+		dev_err(dev, "Failed to create sub-channel: op=%d, host=0x%x\n",
 			vstor_packet->operation, vstor_packet->status);
 		return;
 	}

drivers/scsi/storvsc_drv.c static void storvsc_on_io_completion(struct storvsc_device *stor_device, · line 1189

Quoted 8 lines
drivers/scsi/storvsc_drv.c +1 -1
@@ -1183,7 +1183,7 @@ static void storvsc_on_io_completion(struct storvsc_device *stor_device,
 			STORVSC_LOGGING_WARN : STORVSC_LOGGING_ERROR;
 
 		storvsc_log_ratelimited(device, loglevel,
-			"tag#%d cmd 0x%x status: scsi 0x%x srb 0x%x hv 0x%x\n",
+			"tag#%d cmd 0x%x status: scsi 0x%x srb 0x%x host 0x%x\n",
 			scsi_cmd_to_rq(request->cmd)->tag,
 			stor_pkt->vm_srb.cdb[0],
 			vstor_packet->vm_srb.scsi_status,

I had not realized that handle_multichannel_storage() was displaying the host status in decimal! Ugh.

#4 lore raw
In reply to Roman Kisel

Roman,

Quoted 4 lines

The log statement reports the packet status code as the hv status code which causes confusion when debugging as "hv" might refer to a hypervisor, and sometimes to the host part of the Hyper-V virtualization stack.

Applied to 6.15/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#5 lore raw
In reply to Roman Kisel
Quoted 9 lines · Roman Kisel

The patch includes fixes for the log statements that are ambigious as to what they are logging.

Michael Kelley provided a great insight into the history of the code (** Thank you, Michael! **) and tagged the V1 patch with "Reviewed-by". I am not keeping the tag as a I added one more change to convert the status code to hex in addition to what was approved.

[...]

Applied to 6.15/scsi-queue, thanks!

[1/1] scsi: storvsc: Don't report the host packet status as the hv status

      https://git.kernel.org/mkp/scsi/c/7dcbda8a1d9e
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering