qemu-devel.nongnu.org archive mirror
 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 deadlock on scsi check condition
Date: Tue, 18 Feb 2014 13:40:18 +0100	[thread overview]
Message-ID: <530354B2.5060101@redhat.com> (raw)
In-Reply-To: <1392725319-16789-1-git-send-email-pl@kamp.de>

Il 18/02/2014 13:08, Peter Lieven ha scritto:
> the retry logic was broken because the complete status
> of the task structure was not reset. this resulted in
> an infinite loop retrying the command over and over.
>
> CC: qemu-stable@nongnu.org
> Signed-off-by: Peter Lieven <pl@kamp.de>
> ---
>  block/iscsi.c |    9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/block/iscsi.c b/block/iscsi.c
> index 3c0b728..ded414e 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
> @@ -145,12 +145,13 @@ iscsi_co_generic_cb(struct iscsi_context *iscsi, int status,
>
>      if (iTask->retries-- > 0 && status == SCSI_STATUS_CHECK_CONDITION
>          && task->sense.key == SCSI_SENSE_UNIT_ATTENTION) {
> +        error_report("iSCSI CheckCondition: %s", iscsi_get_error(iscsi));
>          iTask->do_retry = 1;
>          goto out;
>      }
>
>      if (status != SCSI_STATUS_GOOD) {
> -        error_report("iSCSI: Failure. %s", iscsi_get_error(iscsi));
> +        error_report("iSCSI Failure: %s", iscsi_get_error(iscsi));
>      }
>
>  out:
> @@ -325,6 +326,7 @@ retry:
>      }
>
>      if (iTask.do_retry) {
> +        iTask.complete = 0;
>          goto retry;
>      }
>
> @@ -399,6 +401,7 @@ retry:
>      }
>
>      if (iTask.do_retry) {
> +        iTask.complete = 0;
>          goto retry;
>      }
>
> @@ -433,6 +436,7 @@ retry:
>      }
>
>      if (iTask.do_retry) {
> +        iTask.complete = 0;
>          goto retry;
>      }
>
> @@ -683,6 +687,7 @@ retry:
>              scsi_free_scsi_task(iTask.task);
>              iTask.task = NULL;
>          }
> +        iTask.complete = 0;
>          goto retry;
>      }
>
> @@ -767,6 +772,7 @@ retry:
>      }
>
>      if (iTask.do_retry) {
> +        iTask.complete = 0;
>          goto retry;
>      }
>
> @@ -836,6 +842,7 @@ retry:
>      }
>
>      if (iTask.do_retry) {
> +        iTask.complete = 0;
>          goto retry;
>      }
>
>

Applied to scsi-next, thanks.

Paolo

      reply	other threads:[~2014-02-18 12:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-18 12:08 [Qemu-devel] [PATCH] block/iscsi: fix deadlock on scsi check condition Peter Lieven
2014-02-18 12:40 ` 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=530354B2.5060101@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 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).