aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Mazur <krzysiek@podlesie.net>2013-03-27 08:51:14 -0400
committerJeff Garzik <jgarzik@redhat.com>2013-04-03 19:48:49 -0400
commit6d3bfc7be6f80d0c6ee6800d58d573343bf6e260 (patch)
tree89f2969519cf1007b2e36fe10cdc780f4000d1cc
parent8e725c7f8a60feaa88edacd4dee2c754d5ae7706 (diff)
[libata] Fix HDIO_DRIVE_* ioctl() Linux 3.9 regression
On Mon, Mar 25, 2013 at 06:26:50PM +0100, Ronald wrote: > In reply to [1]: I have the same issue. Git bisect took 50+ rebuilds xD > > Smartd does not work anymore since 84a9a8cd9 ([libata] Set proper SK > when CK_COND is set.). > [1] http://www.spinics.net/lists/linux-ide/msg45268.html It seems that the SAM_STAT_CHECK_CONDITION is not cleared causing -EIO, because that patch modified sensebuf and the check for clearing SAM_STAT_CHECK_CONDITION is no longer valid. Fix that. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r--drivers/ata/libata-scsi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 318b41358187..ff44787e5a45 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -532,8 +532,8 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)
532 struct scsi_sense_hdr sshdr; 532 struct scsi_sense_hdr sshdr;
533 scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE, 533 scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE,
534 &sshdr); 534 &sshdr);
535 if (sshdr.sense_key == 0 && 535 if (sshdr.sense_key == RECOVERED_ERROR &&
536 sshdr.asc == 0 && sshdr.ascq == 0) 536 sshdr.asc == 0 && sshdr.ascq == 0x1d)
537 cmd_result &= ~SAM_STAT_CHECK_CONDITION; 537 cmd_result &= ~SAM_STAT_CHECK_CONDITION;
538 } 538 }
539 539
@@ -618,8 +618,8 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg)
618 struct scsi_sense_hdr sshdr; 618 struct scsi_sense_hdr sshdr;
619 scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE, 619 scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE,
620 &sshdr); 620 &sshdr);
621 if (sshdr.sense_key == 0 && 621 if (sshdr.sense_key == RECOVERED_ERROR &&
622 sshdr.asc == 0 && sshdr.ascq == 0) 622 sshdr.asc == 0 && sshdr.ascq == 0x1d)
623 cmd_result &= ~SAM_STAT_CHECK_CONDITION; 623 cmd_result &= ~SAM_STAT_CHECK_CONDITION;
624 } 624 }
625 625