Opened 7 years ago

Closed 7 years ago

Last modified 6 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 7 years ago.
patch to ataprint.cpp

Download all attachments as: .zip

Change History (6)

by oddbondboris, 7 years ago

Attachment: devstatgplog.patch added

patch to ataprint.cpp

comment:1 by Christian Franke, 7 years ago

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

comment:2 by Christian Franke, 7 years ago

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

Fixed in r4604. Thanks.

comment:3 by Christian Franke, 7 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, 7 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

smartctl /dev/sdd -i
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

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Red
Device Model:     WDC WD80EFAX-68LHPN0
Serial Number:    hah
LU WWN Device Id: hah
Firmware Version: 83.H0A83
User Capacity:    8,001,563,222,016 bytes [8.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5400 rpm
Form Factor:      3.5 inches
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-2, ATA8-ACS T13/1699-D revision 4
SATA Version is:  SATA 3.2, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Wed Nov  8 14:04:52 2017 EST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

another drive that exhibits similar behavior unpatched, i'll try to get output of devstat,0 and run patched (i don't have access to this one but know the owner)

    === START OF INFORMATION SECTION ===
    Device Model:     ST12000NM0007-2A1101
    Serial Number:    hah
    LU WWN Device Id: hah
    Firmware Version: SN01
    User Capacity:    12,000,138,625,024 bytes [12.0 TB]
    Sector Sizes:     512 bytes logical, 4096 bytes physical
    Rotation Rate:    7200 rpm
    Form Factor:      3.5 inches
    Device is:        Not in smartctl database [for details use: -P showall]
    ATA Version is:   ACS-3 T13/2161-D revision 5
    SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
    Local Time is:    hah
    SMART support is: Available - device has SMART capability.
    SMART support is: Enabled
    AAM feature is:   Unavailable
    APM feature is:   Unavailable
    Rd look-ahead is: Enabled
    Write cache is:   Enabled
    ATA Security is:  Disabled, frozen [SEC2]
    Write SCT (Get) Feature Control Command failed: scsi error badly formed scsi parameters
    Wt Cache Reorder: Unknown (SCT Feature Control command failed)
     
    General Purpose Log Directory Version 1
    SMART           Log Directory Version 1 [multi-sector log support]
    Address    Access  R/W   Size  Description
    0x00       GPL,SL  R/O      1  Log Directory
    0x01           SL  R/O      1  Summary SMART error log
    0x02           SL  R/O      5  Comprehensive SMART error log
    0x03       GPL     R/O      5  Ext. Comprehensive SMART error log
    0x04       GPL     R/O    256  Device Statistics log
    0x04       SL      R/O      8  Device Statistics log
    0x06           SL  R/O      1  SMART self-test log
    0x07       GPL     R/O      1  Extended self-test log
    0x08       GPL     R/O      2  Power Conditions log
    0x09           SL  R/W      1  Selective self-test log
    0x0c       GPL     R/O   2048  Pending Defects log
    0x10       GPL     R/O      1  SATA NCQ Queued Error log
    0x11       GPL     R/O      1  SATA Phy Event Counters log
    0x13       GPL     R/O      1  SATA NCQ Send and Receive log
    0x15       GPL     R/W      1  SATA Rebuild Assist log
    0x21       GPL     R/O      1  Write stream error log
    0x22       GPL     R/O      1  Read stream error log
    0x24       GPL     R/O    768  Current Device Internal Status Data log
    0x30       GPL,SL  R/O      9  IDENTIFY DEVICE data log
    0x80-0x9f  GPL,SL  R/W     16  Host vendor specific log
    0xa1       GPL,SL  VS      24  Device vendor specific log
    0xa2       GPL     VS   16320  Device vendor specific log
    0xa4       GPL,SL  VS     160  Device vendor specific log
    0xa6       GPL     VS     192  Device vendor specific log
    0xa8-0xa9  GPL,SL  VS     136  Device vendor specific log
    0xab       GPL     VS       1  Device vendor specific log
    0xad       GPL     VS      16  Device vendor specific log
    0xbe-0xbf  GPL     VS   65535  Device vendor specific log
    0xc1       GPL,SL  VS       8  Device vendor specific log
    0xc3       GPL,SL  VS      32  Device vendor specific log
    0xc9       GPL,SL  VS       8  Device vendor specific log
    0xca       GPL,SL  VS      16  Device vendor specific log
    0xd1       GPL     VS     336  Device vendor specific log
    0xd2       GPL     VS   10000  Device vendor specific log
    0xd4       GPL     VS    2048  Device vendor specific log
    0xda       GPL,SL  VS       1  Device vendor specific log
    0xe0       GPL,SL  R/W      1  SCT Command/Status
    0xe1       GPL,SL  R/W      1  SCT Data Transfer

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

Version 1, edited 7 years ago by oddbondboris (previous) (next) (diff)

comment:5 by Christian Franke, 6 years ago

Milestone: Release 6.7Release 7.0

Milestone renamed

Note: See TracTickets for help on using tickets.