ata: HDIO_DRIVE_* ioctl() Linux 3.9 regression
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.).
I hope I'm not stepping on anyone's toe's by chosing the same title. I'm not subscribed to this list.
Just wanted to add a 'me2'
Quoted 11 lines · Ronald
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 whenCK_CONDis set.).I hope I'm not stepping on anyone's toe's by chosing the same title. I'm not subscribed to this list.
Just wanted to add a 'me2'
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.
drivers/ata/libata-scsi.c +4 -4
@@ -532,8 +532,8 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)struct scsi_sense_hdr sshdr;scsi_normalize_sense (sensebuf,SCSI_SENSE_BUFFERSIZE , &sshdr); -if (sshdr.sense_key ==0 && - sshdr.asc ==0 && sshdr.ascq ==0 ) +if (sshdr.sense_key ==RECOVERED_ERROR && + sshdr.asc ==0 && sshdr.ascq ==0x1d ) cmd_result &= ~SAM_STAT_CHECK_CONDITION ; }
@@ -618,8 +618,8 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg)struct scsi_sense_hdr sshdr;scsi_normalize_sense (sensebuf,SCSI_SENSE_BUFFERSIZE , &sshdr); -if (sshdr.sense_key ==0 && - sshdr.asc ==0 && sshdr.ascq ==0 ) +if (sshdr.sense_key ==RECOVERED_ERROR && + sshdr.asc ==0 && sshdr.ascq ==0x1d ) cmd_result &= ~SAM_STAT_CHECK_CONDITION ; }
Krzysiek
Jeff Garzik
AppliedQuoted 33 lines · Krzysztof Mazur
Quoted 11 lines · Ronald
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 whenCK_CONDis set.).I hope I'm not stepping on anyone's toe's by chosing the same title. I'm not subscribed to this list.
Just wanted to add a 'me2'
It seems that the
SAM_STAT_CHECK_CONDITIONis not cleared causing-EIO, because that patch modified sensebuf and the check for clearingSAM_STAT_CHECK_CONDITIONis no longer valid.drivers/ata/libata-scsi.c +2
-2@@ -532,8 +532,8 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)struct scsi_sense_hdr sshdr;scsi_normalize_sense (sensebuf,SCSI_SENSE_BUFFERSIZE , &sshdr); -if (sshdr.sense_key ==0 && - sshdr.asc ==0 && sshdr.ascq ==0 ) +if (sshdr.sense_key ==RECOVERED_ERROR && + sshdr.asc ==0 && sshdr.ascq ==0x1d ) cmd_result &= ~SAM_STAT_CHECK_CONDITION ; }
drivers/ata/libata-scsi.c int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) · line 623
Quoted 8 lines
drivers/ata/libata-scsi.c +2
-2@@ -618,8 +618,8 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg)struct scsi_sense_hdr sshdr;scsi_normalize_sense (sensebuf,SCSI_SENSE_BUFFERSIZE , &sshdr); -if (sshdr.sense_key ==0 && - sshdr.asc ==0 && sshdr.ascq ==0 ) +if (sshdr.sense_key ==RECOVERED_ERROR && + sshdr.asc ==0 && sshdr.ascq ==0x1d ) cmd_result &= ~SAM_STAT_CHECK_CONDITION ;
applied
PATCH 1/1 Fix HDIO_DRIVE_CMD ioctl sense data check
In reply to Ronaldcommit 84a9a8cd9d0aa93c17e5815ab8a9cc4c0a765c63 changed the sense key used for returning task registers, but HDIO_DRIVE_CMD ioctl was not changed accordingly.
Tested: check that SMART ENABLE sent using HDIO_DRIVE_CMD returns 0 instead of EIO.
--- drivers/ata/libata-scsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ata/libata-scsi.c +2 -2
@@ -532,8 +532,8 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)struct scsi_sense_hdr sshdr;scsi_normalize_sense (sensebuf,SCSI_SENSE_BUFFERSIZE , &sshdr); -if (sshdr.sense_key ==0 && - sshdr.asc ==0 && sshdr.ascq ==0 ) +if (sshdr.sense_key ==RECOVERED_ERROR && + sshdr.asc ==0 && sshdr.ascq ==0x1D ) cmd_result &= ~SAM_STAT_CHECK_CONDITION ; }
Signature · 1 line
1.8.1.3
Re: [PATCH] [libata] Fix HDIO_DRIVE_CMD ioctl sense data check
Quoted 29 lines · Gwendal Grignou
commit
84a9a8cd9d0aa93c17e5815ab8a9cc4c0a765c63changed the sense key used for returning task registers, butHDIO_DRIVE_CMDioctl was not changed accordingly.Tested: check that SMART ENABLE sent using
HDIO_DRIVE_CMDreturns 0 instead of EIO.Signed-off-by Gwendal Grignou <[email protected]>--- drivers/ata/libata-scsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/ata/libata-scsi.c +2
-2@@ -532,8 +532,8 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)struct scsi_sense_hdr sshdr;scsi_normalize_sense (sensebuf,SCSI_SENSE_BUFFERSIZE , &sshdr); -if (sshdr.sense_key ==0 && - sshdr.asc ==0 && sshdr.ascq ==0 ) +if (sshdr.sense_key ==RECOVERED_ERROR && + sshdr.asc ==0 && sshdr.ascq ==0x1D ) cmd_result &= ~SAM_STAT_CHECK_CONDITION ; }Signature · 1 line
1.8.1.3
I did not test your patch, but I think that you missed the second test in ata_task_ioctl() and the kernel will still return -EIO in case of HDIO_DRIVE_TASK (0x31e) ioctl.
See http://marc.info/?l=linux-kernel&m=136438868606981&w=2.
The version I've sent fixes the problem for me.
Krzysiek
Re: [PATCH] [libata] Fix HDIO_DRIVE_CMD ioctl sense data check
Yours work.
Quoted 38 lines · Krzysztof Mazur
Quoted 28 lines · Gwendal Grignou
commit
84a9a8cd9d0aa93c17e5815ab8a9cc4c0a765c63changed the sense key used for returning task registers, butHDIO_DRIVE_CMDioctl was not changed accordingly.Tested: check that SMART ENABLE sent using
HDIO_DRIVE_CMDreturns 0 instead of EIO.Signed-off-by Gwendal Grignou <[email protected]>--- drivers/ata/libata-scsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/ata/libata-scsi.c +2
-3@@ -532,8 +532,8 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)struct scsi_sense_hdr sshdr;scsi_normalize_sense (sensebuf,SCSI_SENSE_BUFFERSIZE , &sshdr); -if (sshdr.sense_key ==0 && - sshdr.asc ==0 && sshdr.ascq ==0 ) +if (sshdr.sense_key ==RECOVERED_ERROR && + sshdr.asc ==0 && sshdr.ascq ==0x1D ) cmd_result &= ~SAM_STAT_CHECK_CONDITION ; } --Quoted 1 line
1.8.1.3
I did not test your patch, but I think that you missed the second test in
ata_task_ioctl()and the kernel will still return-EIOin case ofHDIO_DRIVE_TASK(0x31e) ioctl.
See http://marc.info/?l=linux-kernel&m=136438868606981&w=2.
The version I've sent fixes the problem for me.Krzysiek
PATCH v2 1/1 Fix HDIO_DRIVE_CMD ioctl sense data check
commit 84a9a8cd9d0aa93c17e5815ab8a9cc4c0a765c63 changed the sense key used for returning task registers, but HDIO_DRIVE_CMD ioctl was not changed accordingly.
Tested: check that SMART ENABLE sent using HDIO_DRIVE_CMD returns 0 instead of EIO.
Change-Id: I84dccd3febb0467a83a39e55ecfdaaa9686332cd
--- drivers/ata/libata-scsi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/ata/libata-scsi.c +4 -4
@@ -532,8 +532,8 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)struct scsi_sense_hdr sshdr;scsi_normalize_sense (sensebuf,SCSI_SENSE_BUFFERSIZE , &sshdr); -if (sshdr.sense_key ==0 && - sshdr.asc ==0 && sshdr.ascq ==0 ) +if (sshdr.sense_key ==RECOVERED_ERROR && + sshdr.asc ==0 && sshdr.ascq ==0x1D ) cmd_result &= ~SAM_STAT_CHECK_CONDITION ; }
@@ -618,8 +618,8 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg)struct scsi_sense_hdr sshdr;scsi_normalize_sense (sensebuf,SCSI_SENSE_BUFFERSIZE , &sshdr); -if (sshdr.sense_key ==0 && - sshdr.asc ==0 && sshdr.ascq ==0 ) +if (sshdr.sense_key ==RECOVERED_ERROR && + sshdr.asc ==0 && sshdr.ascq ==0x1D ) cmd_result &= ~SAM_STAT_CHECK_CONDITION ; }
Signature · 1 line
1.8.1.3
PATCH v2 1/1 Fix HDIO_DRIVE_CMD ioctl sense data check
commit 84a9a8cd9d0aa93c17e5815ab8a9cc4c0a765c63 changed the sense key used for returning task registers, but HDIO_DRIVE_CMD ioctl was not changed accordingly.
Tested: check that SMART ENABLE sent using HDIO_DRIVE_CMD returns 0 instead of EIO.
--- drivers/ata/libata-scsi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/ata/libata-scsi.c +4 -4
@@ -532,8 +532,8 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)struct scsi_sense_hdr sshdr;scsi_normalize_sense (sensebuf,SCSI_SENSE_BUFFERSIZE , &sshdr); -if (sshdr.sense_key ==0 && - sshdr.asc ==0 && sshdr.ascq ==0 ) +if (sshdr.sense_key ==RECOVERED_ERROR && + sshdr.asc ==0 && sshdr.ascq ==0x1D ) cmd_result &= ~SAM_STAT_CHECK_CONDITION ; }
@@ -618,8 +618,8 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg)struct scsi_sense_hdr sshdr;scsi_normalize_sense (sensebuf,SCSI_SENSE_BUFFERSIZE , &sshdr); -if (sshdr.sense_key ==0 && - sshdr.asc ==0 && sshdr.ascq ==0 ) +if (sshdr.sense_key ==RECOVERED_ERROR && + sshdr.asc ==0 && sshdr.ascq ==0x1D ) cmd_result &= ~SAM_STAT_CHECK_CONDITION ; }
Signature · 1 line
1.8.1.3
Re: [PATCH v2] [libata] Fix HDIO_DRIVE_CMD ioctl sense data check
Quoted 8 lines · Gwendal Grignou
commit
84a9a8cd9d0aa93c17e5815ab8a9cc4c0a765c63changed the sense key used for returning task registers, butHDIO_DRIVE_CMDioctl was not changed accordingly.Tested: check that SMART ENABLE sent using
HDIO_DRIVE_CMDreturns 0 instead of EIO.Signed-off-by Gwendal Grignou <[email protected]>
Works for me. If you like you can add:
Krzysiek
Re: [PATCH v2] [libata] Fix HDIO_DRIVE_CMD ioctl sense data check
In reply to Gwendal GrignouHello.
Quoted 1 line · Gwendal Grignou
commit
84a9a8cd9d0aa93c17e5815ab8a9cc4c0a765c63
Please, also specify that commit's summary line in parens
(or however you like).
Quoted 9 lines
changed the sense key
used for returning task registers, butHDIO_DRIVE_CMDioctl was not changed accordingly.Tested: check that SMART ENABLE sent using
HDIO_DRIVE_CMDreturns 0 instead of EIO.Signed-off-by Gwendal Grignou <[email protected]>
MBR, Sergei
PATCH v3 1/1 Fix HDIO_DRIVE_CMD ioctl sense data check
commit 84a9a8 "Set proper SK when CK_COND is set" changed the sense key used for returning task registers, but HDIO_DRIVE_CMD ioctl was not changed accordingly.
Tested: check that SMART ENABLE sent using HDIO_DRIVE_CMD returns 0 instead of EIO.
--- drivers/ata/libata-scsi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/ata/libata-scsi.c +4 -4
@@ -532,8 +532,8 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)struct scsi_sense_hdr sshdr;scsi_normalize_sense (sensebuf,SCSI_SENSE_BUFFERSIZE , &sshdr); -if (sshdr.sense_key ==0 && - sshdr.asc ==0 && sshdr.ascq ==0 ) +if (sshdr.sense_key ==RECOVERED_ERROR && + sshdr.asc ==0 && sshdr.ascq ==0x1D ) cmd_result &= ~SAM_STAT_CHECK_CONDITION ; }
@@ -618,8 +618,8 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg)struct scsi_sense_hdr sshdr;scsi_normalize_sense (sensebuf,SCSI_SENSE_BUFFERSIZE , &sshdr); -if (sshdr.sense_key ==0 && - sshdr.asc ==0 && sshdr.ascq ==0 ) +if (sshdr.sense_key ==RECOVERED_ERROR && + sshdr.asc ==0 && sshdr.ascq ==0x1D ) cmd_result &= ~SAM_STAT_CHECK_CONDITION ; }
Signature · 1 line
1.8.1.3
Ronald [and other],
Sorry for the bug I introduced. I just send a mail with a patch "[PATCH] [libata] Fix HDIO_DRIVE_CMD ioctl sense data check" that addresses the problem.
Gwendal.
Quoted 15 lines · Ronald
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 whenCK_CONDis set.).I hope I'm not stepping on anyone's toe's by chosing the same title. I'm not subscribed to this list.
Just wanted to add a 'me2'
[1] http://www.spinics.net/lists/linux-ide/msg45268.html
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html