Comment 138 for bug 445852

Revision history for this message
Jean-Louis (jean-louis) wrote :

HI, sorry for my bad english.

I don't have sdd hard disk, but I've watched libatasmart code for other bug and I think that I can help a little for this

In the attachment smartctl-output I can see: "ATA Version is: 5"

In this pdf (2.7MB) http://www.t10.org/t13/project/d1321r3-ATA-ATAPI-5.pdf there are differences if hdd implements "PACKET Command feature set" or no.

In particular if it is implemented, all the smart commands used in libatasmart are prohibited.

The IDENTIFY DEVICE command, if is implemented "PACKET Command feature set", shall return command aborted, but in libatasmart the return value is lost and the "d->identify_valid = FALSE;" is never setted.

Try to add in function disk_identify_device(),
after (line 741) "if ((ret = disk_command(d, SK_ATA_COMMAND_IDENTIFY_DEVICE, SK_DIRECTION_IN, cmd, d->identify, &len)) < 0)"
and before (line 742)"return ret;"
"d->identify_valid = FALSE;"

like this

        if ((ret = disk_command(d, SK_ATA_COMMAND_IDENTIFY_DEVICE, SK_DIRECTION_IN, cmd, d->identify, &len)) < 0) {
                d->identify_valid = FALSE;
                return ret;
        }