qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Blue Swirl" <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] [v2] scsi-disk: correct SCSI error reporting
Date: Thu, 9 Oct 2008 21:12:34 +0300	[thread overview]
Message-ID: <f43fc5580810091112w2bed494ese4a3fd31be3c1d84@mail.gmail.com> (raw)
In-Reply-To: <1223570090.4143.22.camel@frecb07144>

On 10/9/08, Laurent Vivier <Laurent.Vivier@bull.net> wrote:
> Hi,
>
>  scsi-disk.c seems to not report to SCSI controller (through completion()
>  routine) the good error value.
>
>  I've tested this by using a little program trying to read beyond the
>  end of the disk (see attachment read10.c)
>
>  On real disk:
>
>  # ./read10 /dev/sg0
>  READ_10 duration=40 millisecs, resid=0, msg_status=0 status=2 sense=0
>  driver_status 8
>
>  If I use this command with qemu and a scsi disk, the result is:
>
>  # ./read10 /dev/sg0
>  sym0: bad DSA (5da40ff) in done queue.
>  sd 0:0:0:0: ABORT operation started
>  sym0: SCSI BUS reset detected.
>  sym0: SCSI BUS has been reset.
>  sd 0:0:0:0: ABORT operation complete.
>  sd 0:0:0:0: ABORT operation started
>  sd 0:0:0:0: ABORT operation failed.
>  sd 0:0:0:0: DEVICE RESET operation started
>   target0:0:0: control msgout: c.
>  lsi_scsi: error: Unimplemented message 0x0c
>   target0:0:0: has been reset
>  sd 0:0:0:0: DEVICE RESET operation complete.
>  sd 0:0:0:0: DEVICE RESET operation started
>   target0:0:0: control msgout: c.
>  lsi_scsi: error: Unimplemented message 0x0c
>   target0:0:0: has been reset
>  sd 0:0:0:0: DEVICE RESET operation complete.
>  sd 0:0:0:0: M_REJECT received (0:0).
>  sd 0:0:0:0: M_REJECT received (0:0).
>  READ_10 duration=30032 millisecs, resid=0, msg_status=0 status=0 sense=0
>  driver_status 0
>
>  The following patch corrects this issue by sending to the controller not
>  the sense key but the status code.
>
>  The result of the command is now:
>
>  # ./read10 /dev/sg0
>  READ_10 duration=0 millisecs, resid=0, msg_status=0 status=2 sense=0
>  driver_status 8
>
>  This patch has been tested with linux (x86_64 and sparc) and windows XP.
>
>  The VERIFY commands has been implemented (empty) because previously it
>  was simply ignored (and it is needed by windows to format disks).
>
>  Changelog:
>
>  [v2] The v1 was very close to the (reversed) patch of Marcelo Tosatti
>  (r4260) which was breaking sparc scsi support. In fact, management of
>  invalid LUN was wrong: on an invalid LUN, disk sends a SCSI status of
>  "CHECK_CONDITION" and the driver sends "REQUEST_SENSE" to retrieve the
>  sense key. The disk must accept and answer to this request (to send the
>  sense key ILLEGAL_REQUEST). Moreover, INQUIRY with an invalid LUN must
>  answer with PERIPHERAL QUALIFIER field set to 011b and PERIPHERAL DEVICE
>  TYPE field set to 1Fh.

This patch fixes LUN handling and does not cause problems like the
earlier one. I'd like to apply this in a few days, unless there are
objections.

  reply	other threads:[~2008-10-09 18:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-09 16:34 [Qemu-devel] [PATCH] [v2] scsi-disk: correct SCSI error reporting Laurent Vivier
2008-10-09 18:12 ` Blue Swirl [this message]
2008-10-11  9:34 ` Blue Swirl

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=f43fc5580810091112w2bed494ese4a3fd31be3c1d84@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).