Opened 3 months ago

Closed 2 months ago

Last modified 2 months ago

#1892 closed defect (fixed)

smartctl -x return value 4 if SCT ERC is not supported

Reported by: Matthew Eaton Owned by: Christian Franke
Priority: minor Milestone: Release 7.5
Component: smartctl Version:
Keywords: ata Cc:

Description

I have noticed a possible bug that causes the smartctl -x return value to be 4 instead of 0. It seems to be related to SCT support. On SATA drives that support SCT the return value is 4 while with no SCT support the return value is 0. My smartctl version is pre-7.5 r5618.

The attached logs show smartctl -x output with the return value at the bottom.

  1. DC600M with H5.1 firmware does not support SCT (smartctl -x returns 0).
  1. DC600M with H5.3 firmware supports SCT (smartctl -x returns 4).

Attachments (2)

DC600M_H51.txt (9.3 KB ) - added by Matthew Eaton 3 months ago.
DC600M H5.1 with no SCT support returns 0
DC600M_H53.txt (10.6 KB ) - added by Matthew Eaton 3 months ago.
DC600M H5.3 with SCT support returns 4

Download all attachments as: .zip

Change History (8)

by Matthew Eaton, 3 months ago

Attachment: DC600M_H51.txt added

DC600M H5.1 with no SCT support returns 0

by Matthew Eaton, 3 months ago

Attachment: DC600M_H53.txt added

DC600M H5.3 with SCT support returns 4

comment:1 by Christian Franke, 2 months ago

Keywords: ata added
Milestone: undecided

Option -x is the same as:

-H  -i  -g all -g wcreorder -c -A -f brief -l xerror,error -l xselftest,selftest -l selective -l directory -l scttemp -l scterc -l devstat -l defects -l sataphy

Please check which option results the exit status 4. The H5.3 drive only advertises data table support, so the only SCT option actually used should be -l scttemp. Options -g wcreorder and -l scterc should not issue SCT commands.

comment:2 by Matthew Eaton, 2 months ago

I was able to narrow it down to -l scterc. All the other commands returned 0.

smartctl pre-7.5 2024-10-05 r5618 [x86_64-linux-6.8.0-45-generic] (local build)
Copyright (C) 2002-24, Bruce Allen, Christian Franke, www.smartmontools.org

SCT Error Recovery Control command not supported

4

comment:3 by Christian Franke, 2 months ago

Milestone: undecidedRelease 7.5
Owner: set to Christian Franke
Status: newaccepted

Thanks for reporting this and testing.

Exit status 4 is also returned if the SCT ERC support bit is not set and only -l scterc (get) is used. It should only be returned if an actual SCT command failed or if -l scterc,... (set) is used.

comment:4 by Christian Franke, 2 months ago

Summary: smartctl -x return value 4smartctl -x return value 4 if SCT ERC is not supported

comment:5 by Christian Franke, 2 months ago

Resolution: fixed
Status: acceptedclosed

comment:6 by Matthew Eaton, 2 months ago

Confirmed the fix. Thanks!!!

Note: See TracTickets for help on using tickets.