qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Lieven <pl@kamp.de>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH for-2.0] iscsi: recognize "invalid field" ASCQ from WRITE SAME command
Date: Wed, 02 Apr 2014 22:32:32 +0200	[thread overview]
Message-ID: <533C73E0.4050207@kamp.de> (raw)
In-Reply-To: <1396442728-32321-1-git-send-email-pbonzini@redhat.com>

Am 02.04.2014 14:45, schrieb Paolo Bonzini:
> Some targets may return "invalid field" as the ASCQ from WRITE SAME
> if they support the command only without the UNMAP field.  Recognize
> that, and return ENOTSUP just like for "invalid operation code".
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  block/iscsi.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/block/iscsi.c b/block/iscsi.c
> index 6d6cd4f..f01c883 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
> @@ -1012,7 +1012,8 @@ retry:
>  
>      if (iTask.status == SCSI_STATUS_CHECK_CONDITION &&
>          iTask.task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST &&
> -        iTask.task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) {
> +        (iTask.task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE ||
> +	 iTask.task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_FIELD_IN_CDB)) {
>          /* WRITE SAME is not supported by the target */
>          iscsilun->has_write_same = false;
>          scsi_free_scsi_task(iTask.task);

I also checked that

SCSI_SENSE_ASCQ_INVALID_FIELD_IN_CDB

is available in libiscsi 1.4.0 already.


Reviewed-by: Peter Lieven <pl@kamp.de>

      reply	other threads:[~2014-04-02 20:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-02 12:45 [Qemu-devel] [PATCH for-2.0] iscsi: recognize "invalid field" ASCQ from WRITE SAME command Paolo Bonzini
2014-04-02 20:32 ` Peter Lieven [this message]

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=533C73E0.4050207@kamp.de \
    --to=pl@kamp.de \
    --cc=pbonzini@redhat.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).