Opened 7 years ago

Last modified 6 years ago

#870 new patch

[SAS/SCSI] Patch to support SMART attributes support for WDC SAS products

Reported by: Akhilesh_RN Owned by:
Priority: minor Milestone: undecided
Component: smartctl Version: 6.5
Keywords: scsi Cc:

Description

Please find the attached patch for adding smart attributes support WDC SAS products.

Attachments (4)

smart_SAS_Changes.patch (23.1 KB ) - added by Akhilesh_RN 7 years ago.
Smartmon_SAS_results.txt (8.9 KB ) - added by Akhilesh_RN 7 years ago.
Sample_before.txt (5.5 KB ) - added by Akhilesh_RN 7 years ago.
Sample_after.txt (8.8 KB ) - added by Akhilesh_RN 7 years ago.

Download all attachments as: .zip

Change History (13)

by Akhilesh_RN, 7 years ago

Attachment: smart_SAS_Changes.patch added

by Akhilesh_RN, 7 years ago

Attachment: Smartmon_SAS_results.txt added

comment:1 by Christian Franke, 7 years ago

Component: allsmartctl
Milestone: undecided
Priority: majorminor

comment:2 by Christian Franke, 7 years ago

Keywords: scsi added

comment:3 by Alex Samorukov, 7 years ago

Could you please provide more information about functionality added by the patch?

Last edited 7 years ago by Alex Samorukov (previous) (diff)

by Akhilesh_RN, 7 years ago

Attachment: Sample_before.txt added

by Akhilesh_RN, 7 years ago

Attachment: Sample_after.txt added

comment:4 by Akhilesh_RN, 7 years ago

The patch helps in displaying all the smart information of the drive for Sandisk(a WDC brand) SAS products. The smart information lists all the SMART attributes which are supported by the drive firmware. Please find the attached sample results for reference.

comment:5 by Christian Franke, 7 years ago

May be considered for inclusion in smartmontools 6.7.

Patch should be reviewed by main author of SCSI code (dpgilbert).

Some notes from compile test and and quick review:

  • Compile errors/warnings (repeated messages not shown):
    g++ 6.4.0 -std=gnu++03:
    scsiprint.cpp:2145:90: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
    scsiprint.cpp:2145:90: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    
    clang++ 4.0.0:
    scsiprint.cpp:2142:40: error: expected expression
    
    cppcheck 1.81:
    [scsiprint.cpp:1462]: (style) The scope of the variable 'product' can be reduced.
    [scsiprint.cpp:1462]: (style) The scope of the variable 'revision' can be reduced.
    [scsiprint.cpp:2130]: (error) Memory leak: scsiSmartSetting.customerName
    
  • Use of calloc() without nullptr check. Use new instead or better avoid it at all (see raw_buffer).
  • Misleading indentation, use of tab characters instead of blanks (see .editorconfig file).
  • Missing static for local functions.
  • Unnecessary casts char [] to char *.
  • Missing '\n' in error message.
  • Declarations added to ataprint.h which are not part of function interface.

Is is assured that the new code avoids possibly unsupported SCSI commands on (non-WDC or WDC) drives which do not support these ATA-like Attributes?

Last edited 7 years ago by Christian Franke (previous) (diff)

comment:6 by Alex Samorukov, 7 years ago

Milestone: undecidedRelease 6.7
Summary: Smart attributes support for WDC SAS products[SAS/SCSI] Smart attributes support for WDC SAS products

comment:7 by Alex Samorukov, 7 years ago

Summary: [SAS/SCSI] Smart attributes support for WDC SAS products[SAS/SCSI] Patch to support SMART attributes support for WDC SAS products

comment:8 by Alex Samorukov, 7 years ago

Some other suggestions:

  1. Please provide information if there is any vendor documentation about this log pages.
  2. I think if it is WDC specific only - this should be noted in the output. E.g. "WDC specific SMART attributes" or whatever. Same with a function names.
  3. To make automatic parser life easier - please use standard names for the standard attributes defined in the drivedb.h (e.g. attr. 9 or 12).
  4. In the drivedb entries please include model which was using for the test
  5. There is attribute logging code in the smartd. I think it would be great to add such attributes to it as well, however, it is not critical.

I think that patch provided useful functionality for the WDC drives owners.

Version 0, edited 7 years ago by Alex Samorukov (next)

comment:9 by Christian Franke, 6 years ago

Milestone: Release 6.7undecided

No feedback from reporter.

Note: See TracTickets for help on using tickets.