diff --git a/smartmontools/ChangeLog b/smartmontools/ChangeLog index b04d48e965ec02fd93a3bee3e2e723ff5bf2b25d..4ded48f9b0313d5d0f3f801e43cd241cab8e5c30 100644 --- a/smartmontools/ChangeLog +++ b/smartmontools/ChangeLog @@ -1,5 +1,11 @@ $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> scsicmds.cpp,scsiprint.cpp: the "Long (extended) diff --git a/smartmontools/scsiprint.cpp b/smartmontools/scsiprint.cpp index 221fdd89fcd5ce2db5ec09d2d4525869438f2c95..3f77f48a6884683b08b22db284e0e18dcb5f9147 100644 --- a/smartmontools/scsiprint.cpp +++ b/smartmontools/scsiprint.cpp @@ -1468,6 +1468,7 @@ scsiPrintZBDeviceStats(scsi_device * device) static const char * hname = "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, gBuf, LOG_RESP_LONG_LEN, 0))) { print_on(); @@ -1499,6 +1500,9 @@ scsiPrintZBDeviceStats(scsi_device * device) int pc = sg_get_unaligned_be16(ucp + 0); // pcb = ucp[2]; int pl = ucp[3] + 4; + + if (pl < 12) + goto skip; /* DC HC650 has non-compliant 4 byte parameters */ switch (pc) { case 0: q = "Maximum open zones"; @@ -1575,6 +1579,7 @@ scsiPrintZBDeviceStats(scsi_device * device) default: /* ignore other parameter codes */ break; } +skip: num -= pl; ucp += pl; }