Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 89877e42827f16fa5f86b1df0c2860b1 > files > 2127

kernel-2.6.18-128.1.10.el5.src.rpm

From: Mark McLoughlin <markmc@redhat.com>
Date: Tue, 23 Sep 2008 11:06:17 +0100
Subject: [scsi] fix hang introduced by failfast changes
Message-id: 1222164377.2353.8.camel@blaa
O-Subject: [RHEL5.3 PATCH] scsi: Fix regression introduced by typo in failfast changes
Bugzilla: 463416

This is for BZ 463416.

With 2.6.18.4-116, udev can be seen to hang on some machines
when loading sr_mod.

The regression was introduced by:

  commit 325d5462da6613a1353fa8cbc4603e8f056e67b1
  [scsi] modify failfast so it does not always fail fast

Fix what appears to be an obvious typo - SCSI_MLQUEUE_HOST_BUSY
etc. are always non-zero; we should be checking whether the
reason code matches these.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index c19492e..7a26d25 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -168,8 +168,9 @@ int scsi_attempt_requeue_command(struct scsi_cmnd *cmd, int reason)
 	 * want to bypass the failfast and retry checks like we do
 	 * with the new ones.
 	 */
-	if (SCSI_MLQUEUE_HOST_BUSY || SCSI_MLQUEUE_DEVICE_BUSY ||
-	    SCSI_MLQUEUE_EH_RETRY)
+	if (reason == SCSI_MLQUEUE_HOST_BUSY ||
+	    reason == SCSI_MLQUEUE_DEVICE_BUSY ||
+	    reason == SCSI_MLQUEUE_EH_RETRY)
 		goto cleanup;
 
 	if (!scsi_ign_failfast(reason) && scsi_disposition_retry(reason)) {