Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#922 closed patch (fixed)

-l devstat does not work if gp devstat log is 256 sectors

Reported by: oddbondboris Owned by: Christian Franke
Priority: minor Milestone: Release 7.0
Component: smartctl Version:
Keywords: ata Cc:

Description

smartctl does not use the 9 bit value from the directory properly and instead reads the value 256 as zero

Steps to reproduce:
smartctl -l devstat /dev/sdX on any drive that has a directory such as this

0x04       GPL     R/O    256  Device Statistics log

Expected behavior:
print device statistics
patched version shown

#smartctl -l devstat /dev/sdd
smartctl 6.7 2017-11-06 r4602 [x86_64-linux-4.9.16-gentoo] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org

Device Statistics (GP Log 0x04)
Page  Offset Size        Value Flags Description
0x01  =====  =               =  ===  == General Statistics (rev 1) ==
0x01  0x008  4               6  ---  Lifetime Power-On Resets
0x01  0x010  4             913  ---  Power-on Hours
....

Actual Behavior

#smartctl -l devstat /dev/sdd
smartctl 6.7 2017-11-06 r4602 [x86_64-linux-4.9.16-gentoo] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org

Device Statistics (GP/SMART Log 0x04) not supported

fix:
included patch, enable already existing code to parse >8bit values in GetNumLogSectors when reading gplog devstat logs.

Attachments (1)

devstatgplog.patch (524 bytes ) - added by oddbondboris 6 years ago.
patch to ataprint.cpp

Download all attachments as: .zip

Change History (6)

by oddbondboris, 6 years ago

Attachment: devstatgplog.patch added

patch to ataprint.cpp

comment:1 by Christian Franke, 6 years ago

Milestone: Release 6.7
Owner: set to Christian Franke
Status: newaccepted

comment:2 by Christian Franke, 6 years ago

Keywords: devstat removed
Resolution: fixed
Status: acceptedclosed
Type: defectpatch

Fixed in r4604. Thanks.

comment:3 by Christian Franke, 6 years ago

Keywords: ata added

Does this device actually support Device Statistics page 255 (Vendor Specific Statistics) ?

If possible, please provide smartctl [-q noserial] -x -l devstat,0 ... sample output for an affected device.

in reply to:  3 comment:4 by oddbondboris, 6 years ago

Replying to chrfranke:

Does this device actually support Device Statistics page 255 (Vendor Specific Statistics) ?

If possible, please provide smartctl [-q noserial] -x -l devstat,0 ... sample output for an affected device.

smartctl /dev/sdd -l devstat,0
smartctl 6.7 2017-11-06 r4602 [x86_64-linux-4.9.16-gentoo] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org

Device Statistics (GP Log 0x04) supported pages
Page  Description
0x00  List of supported log pages
0x01  General Statistics
0x03  Rotating Media Statistics
0x04  General Errors Statistics
0x05  Temperature Statistics
0x06  Transport Statistics
0xff  Vendor Specific Statistics

however theres nothing in said log i can see

smartctl /dev/sdd -l devstat,0xff
smartctl 6.7 2017-11-06 r4602 [x86_64-linux-4.9.16-gentoo] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org

Device Statistics (GP Log 0x04)
Page  Offset Size        Value Flags Description
0xff  =====  =               =  ===  == Vendor Specific Statistics (rev 1) ==
                                |||_ C monitored condition met
                                ||__ D supports DSN
                                |___ N normalized value

Version 0, edited 6 years ago by oddbondboris (next)

comment:5 by Christian Franke, 5 years ago

Milestone: Release 6.7Release 7.0

Milestone renamed

Note: See TracTickets for help on using tickets.