summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sd_zbc.c
diff options
context:
space:
mode:
authorDamien Le Moal <damien.lemoal@wdc.com>2019-11-25 08:05:18 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2019-11-27 03:43:22 +0100
commita35989a0723c53b0364322e39c7a9495336ff7e6 (patch)
treee1358f48115b8c9e052bada6eac2ba47b094130e /drivers/scsi/sd_zbc.c
parentscsi: qla2xxx: Fix qla2x00_request_irqs() for MSI (diff)
downloadlinux-a35989a0723c53b0364322e39c7a9495336ff7e6.tar.xz
linux-a35989a0723c53b0364322e39c7a9495336ff7e6.zip
scsi: sd_zbc: Improve report zones error printout
In the case of a report zones command failure, instead of simply printing the host_byte and driver_byte values returned, print a message that is more human readable and useful, adding sense codes too. To do so, use the already defined sd_print_sense_hdr() and sd_print_result() functions by moving the declaration of these functions into sd.h. Link: https://lore.kernel.org/r/20191125070518.951717-1-damien.lemoal@wdc.com Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/sd_zbc.c')
-rw-r--r--drivers/scsi/sd_zbc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c
index de4019dc0f0b..71db972bf71f 100644
--- a/drivers/scsi/sd_zbc.c
+++ b/drivers/scsi/sd_zbc.c
@@ -87,9 +87,11 @@ static int sd_zbc_do_report_zones(struct scsi_disk *sdkp, unsigned char *buf,
timeout, SD_MAX_RETRIES, NULL);
if (result) {
sd_printk(KERN_ERR, sdkp,
- "REPORT ZONES lba %llu failed with %d/%d\n",
- (unsigned long long)lba,
- host_byte(result), driver_byte(result));
+ "REPORT ZONES start lba %llu failed\n", lba);
+ sd_print_result(sdkp, "REPORT ZONES", result);
+ if (driver_byte(result) == DRIVER_SENSE &&
+ scsi_sense_valid(&sshdr))
+ sd_print_sense_hdr(sdkp, &sshdr);
return -EIO;
}