All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Lieven <pl@kamp.de>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, peter.maydell@linaro.org,
	ronniesahlberg@gmail.com, stefanha@redhat.com,
	qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] block/iscsi: fix segfault if writesame fails
Date: Sat, 22 Feb 2014 15:59:57 +0100	[thread overview]
Message-ID: <5308BB6D.5070705@redhat.com> (raw)
In-Reply-To: <1393071444-29556-1-git-send-email-pl@kamp.de>

Il 22/02/2014 13:17, Peter Lieven ha scritto:
> commit fa6252b0 introduced a segfault because it tries
> to read iTask.task->sense after iTask.task has been
> freed.
>
> CC: qemu-stable@nongnu.org

Not needed, it's not in the 1.7.1 pending release.  Applied to 
scsi-next, thanks.

Paolo

> Signed-off-by: Peter Lieven <pl@kamp.de>
> ---
>  block/iscsi.c |   17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/block/iscsi.c b/block/iscsi.c
> index f8e496f..123fa06 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
> @@ -830,6 +830,15 @@ retry:
>          qemu_coroutine_yield();
>      }
>
> +    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) {
> +        /* WRITE SAME is not supported by the target */
> +        iscsilun->has_write_same = false;
> +        scsi_free_scsi_task(iTask.task);
> +        return -ENOTSUP;
> +    }
> +
>      if (iTask.task != NULL) {
>          scsi_free_scsi_task(iTask.task);
>          iTask.task = NULL;
> @@ -840,14 +849,6 @@ retry:
>      }
>
>      if (iTask.status != SCSI_STATUS_GOOD) {
> -        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) {
> -            /* WRITE SAME is not supported by the target */
> -            iscsilun->has_write_same = false;
> -            return -ENOTSUP;
> -        }
> -
>          return -EIO;
>      }
>
>

      reply	other threads:[~2014-02-22 15:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-22 12:17 [Qemu-devel] [PATCH] block/iscsi: fix segfault if writesame fails Peter Lieven
2014-02-22 14:59 ` Paolo Bonzini [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=5308BB6D.5070705@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=pl@kamp.de \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=ronniesahlberg@gmail.com \
    --cc=stefanha@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.