From af34d8d23f70bef63fcf3b9eb4b3b87d2ec3d99b Mon Sep 17 00:00:00 2001 From: Simon Murray Date: Thu, 14 Jan 2016 10:07:07 +0000 Subject: [PATCH] Add Support For Large Raw Values On SSDs the raw LBA writes field grows to over 4 billion fairly rapidly which overflows the 32bit raw counter. Evidently another 16 of the remaining padding bits are for high order bits --- check_scsi_smart.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/check_scsi_smart.c b/check_scsi_smart.c index 2b3cd3a..d5f3c26 100644 --- a/check_scsi_smart.c +++ b/check_scsi_smart.c @@ -120,8 +120,9 @@ typedef struct __attribute__((packed)) { uint16_t flags; uint8_t value; uint8_t worst; - uint32_t raw; - uint8_t pad[3]; + uint32_t raw_lo; + uint16_t raw_hi; + uint8_t pad; } smart_attribute; /* @@ -541,7 +542,7 @@ int main(int argc, char** argv) { smart_thresholds st; ata_smart_read_thresholds(fd, (unsigned char*)&st); - printf("ID Name Value Worst Thresh Type Updated Raw Status\n"); + printf("ID Name Value Worst Thresh Type Updated Raw Status\n"); int i=0; for(; i