diff --git a/smartmontools/CHANGELOG b/smartmontools/CHANGELOG index 44c12131f52072fe80730e745694b05dca5d56d5..46c43f5acc39e6eb27d492b17dec2aa2d03cee29 100644 --- a/smartmontools/CHANGELOG +++ b/smartmontools/CHANGELOG @@ -43,6 +43,10 @@ NOTES FOR FUTURE RELEASES: see TODO file. <DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE> + [CF] Linux: Add workaround for Adaptec series 2, 5 and 5Z controllers + with firmware >= 17380. Patch was provided by Phil Wilson, see: + http://linux.adaptec.com/2009/07/24/using-smartmontools-538-with-series-255z-controllers-with-firmware-17380-onwards + [CF] configure.in: Add '-fno-strict-aliasing' to CXXFLAGS if supported. This suppresses gcc 4.4.1 warnings on Linux and avoids possible unsafe optimizations (ticket #23). diff --git a/smartmontools/os_linux.cpp b/smartmontools/os_linux.cpp index 5993f113dba5b4629ebd8df980846f0d0a754c41..2ec4b616dbac336950cabeee7073e3a3a8f9207e 100644 --- a/smartmontools/os_linux.cpp +++ b/smartmontools/os_linux.cpp @@ -493,6 +493,7 @@ int linux_ata_device::ata_command_interface(smart_command_set command, int selec #define SG_IO_RESP_SENSE_LEN 64 /* large enough see buffer */ #define LSCSI_DRIVER_MASK 0xf /* mask out "suggestions" */ #define LSCSI_DRIVER_SENSE 0x8 /* alternate CHECK CONDITION indication */ +#define LSCSI_DID_ERROR 0x7 /* Need to work around aacraid driver quirk */ #define LSCSI_DRIVER_TIMEOUT 0x6 #define LSCSI_DID_TIME_OUT 0x3 #define LSCSI_DID_BUS_BUSY 0x2 @@ -617,7 +618,10 @@ static int sg_io_cmnd_io(int dev_fd, struct scsi_cmnd_io * iop, int report, (LSCSI_DID_TIME_OUT == io_hdr.host_status)) return -ETIMEDOUT; else - return -EIO; /* catch all */ + /* Check for DID_ERROR - workaround for aacraid driver quirk */ + if (LSCSI_DID_ERROR != io_hdr.host_status) { + return -EIO; /* catch all if not DID_ERR */ + } } if (0 != masked_driver_status) { if (LSCSI_DRIVER_TIMEOUT == masked_driver_status)