From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFjya-0008GV-Fv for qemu-devel@nongnu.org; Tue, 18 Feb 2014 07:40:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFjyR-0005Ha-OY for qemu-devel@nongnu.org; Tue, 18 Feb 2014 07:40:40 -0500 Message-ID: <530354B2.5060101@redhat.com> Date: Tue, 18 Feb 2014 13:40:18 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1392725319-16789-1-git-send-email-pl@kamp.de> In-Reply-To: <1392725319-16789-1-git-send-email-pl@kamp.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] block/iscsi: fix deadlock on scsi check condition List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven , qemu-devel@nongnu.org Cc: kwolf@redhat.com, peter.maydell@linaro.org, ronniesahlberg@gmail.com, stefanha@redhat.com, qemu-stable@nongnu.org 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 > --- > 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