Skip to content

v1.12 exit code 5 on --get WCE command #2

@maxxwizard

Description

@maxxwizard

v1.10 and v1.12 yield the same output on similar hardware but exit code is different.

[root@xyz ~]# sdparm --version
version: 1.10 20160222 [svn: r279]

[root@xyz ~]# sdparm --get WCE /dev/sdy --verbose; echo "exit code" $?
mp_settings: page,subpage=0x8,0x0  num=1
  [0x8,0x0]  pdt=0 start_byte=0x2 start_bit=2 num_bits=1  val=0  acronym: WCE
    /dev/sdy: ATA       WDC  WUH721818AL  W233
WCE           1  [cha: y]
exit code 0
[root@abc ~]# sdparm --version
version: 1.12 20210421 [svn: r347]

[root@abc ~]# sdparm --get WCE /dev/sdy --verbose; echo "exit code" $?
mp_settings: page,subpage=0x8,0x0  num=1
  [0x8,0x0]  pdt=5120 start_byte=0x2 start_bit=2 num_bits=1  val=0  acronym: WCE
    /dev/sdy: ATA       WDC  WUH721818AL  W233
WCE           1  [cha: y]
exit code 5

I did a quick strace diff between the 2 versions and find nothing significant.

Exit code 5 according to man pages:

the DEVICE reports an "illegal request" with an additional sense code other than "invalid operation code". This is often a supported command with a field set requesting an unsupported capability. For commands that require a "service action" field this value can indicate that the command is not supported.

I thought perhaps WCE isn't a supported capability but I can change the bit just fine.

[root@abc ~]# sdparm --set WCE=0 /dev/sdy --verbose; echo "exit code" $?
mp_settings: page,subpage=0x8,0x0  num=1
  pdt=5120 start_byte=0x2 start_bit=2 num_bits=1  val=0  acronym: WCE
    /dev/sdy: ATA       WDC  WUH721818AL  W233
    mode sense(10) cdb: [5a 00 08 00 00 00 00 00 04 00]
    mode sense(10) cdb: [5a 00 08 00 00 00 00 00 24 00]
    mode select(10) cdb: [55 10 00 00 00 00 00 00 24 00]
exit code 0

[root@abc ~]# sdparm --get WCE /dev/sdy --verbose; echo "exit code" $?
mp_settings: page,subpage=0x8,0x0  num=1
  [0x8,0x0]  pdt=5120 start_byte=0x2 start_bit=2 num_bits=1  val=0  acronym: WCE
    /dev/sdy: ATA       WDC  WUH721818AL  W233
WCE           0  [cha: y]
exit code 5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions