Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756501Ab3C2SbK (ORCPT ); Fri, 29 Mar 2013 14:31:10 -0400 Received: from mtaout03-winn.ispmail.ntl.com ([81.103.221.49]:49371 "EHLO mtaout03-winn.ispmail.ntl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756390Ab3C2SbI (ORCPT ); Fri, 29 Mar 2013 14:31:08 -0400 Date: Fri, 29 Mar 2013 18:31:03 +0000 From: Ken Moffat To: Gwendal Grignou Cc: linux-kernel@vger.kernel.org, jgarzik@redhat.com Subject: Re: [PATCH] [libata] Fix HDIO_DRIVE_CMD ioctl sense data check Message-ID: <20130329183103.GA27693@milliways> References: <1364536609-17398-1-git-send-email-gwendal@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1364536609-17398-1-git-send-email-gwendal@google.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Cloudmark-Analysis: v=1.1 cv=GaEGOwq9FwezmTggA+b6yC6zDZF2HYaK6RN/tSqdnVA= c=1 sm=0 a=wom5GMh1gUkA:10 a=7tItc54Vev4A:10 a=uObrxnre4hsA:10 a=8nJEP1OIZ-IA:10 a=1XWaLZrsAAAA:8 a=rQh_3bXj2wYxUjjygnUA:9 a=wPNLvfGTeEIA:10 a=UTB_XpHje0EA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2388 Lines: 62 On Thu, Mar 28, 2013 at 10:56:49PM -0700, Gwendal Grignou wrote: Hmm, not sure. Smartd started and was happy to monitor the disk, but I got two new messages between 'found in smartd database' and 'is SMART capable. Adding to "monitor" list' - Mar 29 17:26:42 ac4tv smartd[2481]: Device: /dev/sda, not capable of SMART Health Status check Mar 29 17:26:42 ac4tv smartd[2481]: Device: /dev/sda, enable SMART Automatic Offline Testing failed. I've seen the first (intermittently) when a drive was starting to fail, and apparently there was a taskfile issue in the days of 2.6.22 which also caused it to appear. I don't think I've seen the second of these before. After going back and forth between the kernel where I reverted your original patch, and regular rc4 plus this new patch the output from running smartctl as root all seems to be consistent (including 'Passed' for the health check). I'm now running with the patch again, and I've started a manual 'long' test (which will take 85 minutes, the default 'offline' is about 150 minutes). > 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. > > Signed-off-by: Gwendal Grignou > --- > drivers/ata/libata-scsi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c > index 318b413..e05bf4c 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) > 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; > } > > -- > 1.8.1.3 -- das eine Mal als Trag?die, das andere Mal als Farce -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/