From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4Z4F-0003Bh-Aw for qemu-devel@nongnu.org; Tue, 08 Jul 2014 13:20:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4Z3y-0007Se-UI for qemu-devel@nongnu.org; Tue, 08 Jul 2014 13:20:35 -0400 Received: from e7.ny.us.ibm.com ([32.97.182.137]:55084) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4Z3y-0007SS-Pk for qemu-devel@nongnu.org; Tue, 08 Jul 2014 13:20:18 -0400 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Jul 2014 13:20:18 -0400 From: Michael Roth Date: Tue, 8 Jul 2014 12:16:34 -0500 Message-Id: <1404839947-1086-4-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1404839947-1086-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1404839947-1086-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 003/156] block/iscsi: fix deadlock on scsi check condition List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org From: Peter Lieven 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 Signed-off-by: Paolo Bonzini (cherry picked from commit 837c390137193e715fee20b35c0ddb164b1c4fa4) Conflicts: block/iscsi.c *only modified retry clauses present before 063c3378 Signed-off-by: Michael Roth --- block/iscsi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/block/iscsi.c b/block/iscsi.c index a410a28..75a4001 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -143,12 +143,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: @@ -868,6 +869,7 @@ retry: scsi_free_scsi_task(iTask.task); iTask.task = NULL; } + iTask.complete = 0; goto retry; } @@ -964,6 +966,7 @@ retry: } if (iTask.do_retry) { + iTask.complete = 0; goto retry; } -- 1.9.1