Opened 16 months ago

Last modified 14 months 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: Release 6.7
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 16 months ago.
Smartmon_SAS_results.txt (8.9 KB) - added by Akhilesh_RN 16 months ago.
Sample_before.txt (5.5 KB) - added by Akhilesh_RN 14 months ago.
Sample_after.txt (8.8 KB) - added by Akhilesh_RN 14 months ago.

Download all attachments as: .zip

Change History (12)

Changed 16 months ago by Akhilesh_RN

Attachment: smart_SAS_Changes.patch added

Changed 16 months ago by Akhilesh_RN

Attachment: Smartmon_SAS_results.txt added

comment:1 Changed 16 months ago by Christian Franke

Component: allsmartctl
Milestone: undecided
Priority: majorminor

comment:2 Changed 16 months ago by Christian Franke

Keywords: scsi added

comment:3 Changed 14 months ago by Alex Samorukov

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

Last edited 14 months ago by Alex Samorukov (previous) (diff)

Changed 14 months ago by Akhilesh_RN

Attachment: Sample_before.txt added

Changed 14 months ago by Akhilesh_RN

Attachment: Sample_after.txt added

comment:4 Changed 14 months ago by Akhilesh_RN

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 Changed 14 months ago by Christian Franke

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 14 months ago by Christian Franke (previous) (diff)

comment:6 Changed 14 months ago by Alex Samorukov

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

comment:7 Changed 14 months ago by Alex Samorukov

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

comment:8 Changed 14 months ago by Alex Samorukov

Some other suggestions:

  • Please provide information if there is any vendor documentation about this log pages.
  • 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.
  • 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).
  • In the drivedb entries please include model which was using for the test
  • 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 providing useful functionality for the WDC drives owners, so if all issues are resolved it could be included in the 6.7.

Last edited 14 months ago by Alex Samorukov (previous) (diff)
Note: See TracTickets for help on using tickets.