Skip to content
Snippets Groups Projects
Commit 0b2253dc authored by dpgilbert's avatar dpgilbert
Browse files

scsiprint.cpp: fix issue with Zoned block device statistics lpage specific to...

scsiprint.cpp: fix issue with Zoned block device statistics lpage specific to the WDC DC HC650 SAS ZBC disk

git-svn-id: https://svn.code.sf.net/p/smartmontools/code/trunk@5306 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 643395e6
Branches
No related tags found
No related merge requests found
$Id$ $Id$
2022-01-29 Douglas Gilbert <dgilbert@interlog.com>
scsiprint.cpp: fix issue with Zoned block device
statistics lpage specific to the WDC DC HC650
SAS ZBC disk. Visible with smartctl -x
2022-01-28 Douglas Gilbert <dgilbert@interlog.com> 2022-01-28 Douglas Gilbert <dgilbert@interlog.com>
scsicmds.cpp,scsiprint.cpp: the "Long (extended) scsicmds.cpp,scsiprint.cpp: the "Long (extended)
......
...@@ -1468,6 +1468,7 @@ scsiPrintZBDeviceStats(scsi_device * device) ...@@ -1468,6 +1468,7 @@ scsiPrintZBDeviceStats(scsi_device * device)
static const char * hname = "Zoned block device statistics"; static const char * hname = "Zoned block device statistics";
static const char * jname = "scsi_zoned_block_device_statistics"; static const char * jname = "scsi_zoned_block_device_statistics";
jout("%s:\n", hname);
if ((err = scsiLogSense(device, DEVICE_STATS_LPAGE, ZB_DEV_STATS_L_SPAGE, if ((err = scsiLogSense(device, DEVICE_STATS_LPAGE, ZB_DEV_STATS_L_SPAGE,
gBuf, LOG_RESP_LONG_LEN, 0))) { gBuf, LOG_RESP_LONG_LEN, 0))) {
print_on(); print_on();
...@@ -1499,6 +1500,9 @@ scsiPrintZBDeviceStats(scsi_device * device) ...@@ -1499,6 +1500,9 @@ scsiPrintZBDeviceStats(scsi_device * device)
int pc = sg_get_unaligned_be16(ucp + 0); int pc = sg_get_unaligned_be16(ucp + 0);
// pcb = ucp[2]; // pcb = ucp[2];
int pl = ucp[3] + 4; int pl = ucp[3] + 4;
if (pl < 12)
goto skip; /* DC HC650 has non-compliant 4 byte parameters */
switch (pc) { switch (pc) {
case 0: case 0:
q = "Maximum open zones"; q = "Maximum open zones";
...@@ -1575,6 +1579,7 @@ scsiPrintZBDeviceStats(scsi_device * device) ...@@ -1575,6 +1579,7 @@ scsiPrintZBDeviceStats(scsi_device * device)
default: /* ignore other parameter codes */ default: /* ignore other parameter codes */
break; break;
} }
skip:
num -= pl; num -= pl;
ucp += pl; ucp += pl;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment