mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Mazur <krzysiek@podlesie.net>
To: gwendal@google.com, jgarzik@pobox.com
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: ata: HDIO_DRIVE_* ioctl() Linux 3.9 regression
Date: Sat, 23 Mar 2013 09:20:41 +0100	[thread overview]
Message-ID: <20130323082040.GA19848@shrek.podlesie.net> (raw)

Hi,

commit 84a9a8cd9d0aa93c17e5815ab8a9cc4c0a765c63
("[libata] Set proper SK when CK_COND is set") breaks
"SMART Status command" ATA command issued by
smartctl -d ata -a /dev/sda at least on FUJITSU MHV2060AH
on ICH6 IDE Controller. The kernel returns -EIO on
HDIO_DRIVE_TASK (0x31e) or HDIO_DRIVE_CMD (0x31f) ioctl,
probably due to RECOVERED_ERROR translated to -EIO.

The regression still exists in v3.9-rc3-218-g0a7e453.

Ancient smartctl like 5.33 give up after such error:

  smartctl version 5.33 [i686-pc-linux-gnu] Copyright (C) 2002-4 Bruce Allen
  Home page is http://smartmontools.sourceforge.net/
  
  === START OF INFORMATION SECTION ===
  Device Model:     FUJITSU MHV2060AH
  Serial Number:    NT29T5B2D23C
  Firmware Version: 00830096
  User Capacity:    60,011,642,880 bytes
  Device is:        Not in smartctl database [for details use: -P showall]
  ATA Version is:   6
  ATA Standard is:  ATA/ATAPI-6 T13 1410D revision 3a
  Local Time is:    Sat Mar 23 01:55:27 2013 CET
  SMART support is: Available - device has SMART capability.
  SMART support is: Enabled
  
  SMART Disabled. Use option -s with argument 'on' to enable it.

 # strace -x smartctl-5.33 -d ata -a /dev/sda 2>&1 | tail -n 10
  write(1, "SMART support is: Available - de"..., 59SMART support is: Available - device has SMART capability.
  ) = 59
  write(1, "SMART support is: Enabled\n", 26SMART support is: Enabled
  ) = 26
  write(1, "\n", 1
  )                       = 1
  ioctl(3, 0x31f, 0x7f98a240)             = -1 EIO (Input/output error)
  write(1, "SMART Disabled. Use option -s wi"..., 63SMART Disabled. Use option -s with argument 'on' to enable it.
  ) = 63
  exit_group(0)                           = ?


Newer smartctl versions (at least 6.1) just reports an error in such
case and continue:

  Error SMART Status command failed: Input/output error

 # strace -x smartctl-6.1 -d ata -a /dev/sda 2>&1
  ...
  ioctl(3, 0x31e, 0x7fac798c)             = -1 EIO (Input/output error)
  write(1, "Error SMART Status command faile"..., 54Error SMART Status command failed: Input/output error
  ...

On older kernels ioctl() returns 0 instead of -EIO.

Thanks,
Krzysiek

             reply	other threads:[~2013-03-23  8:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-23  8:20 Krzysztof Mazur [this message]
2013-03-25 17:26 Ronald
2013-03-27 12:51 ` Krzysztof Mazur
2013-04-03 23:49   ` Jeff Garzik
2013-03-29 15:28 ` Gwendal Grignou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130323082040.GA19848@shrek.podlesie.net \
    --to=krzysiek@podlesie.net \
    --cc=gwendal@google.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®