Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=568d303b5b3f0f6432ae8f56ecdb0beb2341288e
Commit:     568d303b5b3f0f6432ae8f56ecdb0beb2341288e
Parent:     bd976f62cd6c6dda1ce57bf3e84447e94844868a
Author:     Mike Christie <[EMAIL PROTECTED]>
AuthorDate: Thu Jan 31 13:36:47 2008 -0600
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Thu Feb 7 18:02:35 2008 -0600

    [SCSI] qla4xxx: fix recovery timer and session unblock race
    
    If qla4xxx is resetting up a session and the recovery timer
    fires we do not want to just set it to dead, because
    the dpc thread could have just set it to online and is in the
    middle of resetting it up.
    
    Signed-off-by: Mike Christie <[EMAIL PROTECTED]>
    Cc: David Somayajulu <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
---
 drivers/scsi/qla4xxx/ql4_os.c |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 437d169..d4dd149 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -124,16 +124,19 @@ static void qla4xxx_recovery_timedout(struct 
iscsi_cls_session *session)
        struct ddb_entry *ddb_entry = session->dd_data;
        struct scsi_qla_host *ha = ddb_entry->ha;
 
-       DEBUG2(printk("scsi%ld: %s: index [%d] port down retry count of (%d) "
-                     "secs exhausted, marking device DEAD.\n", ha->host_no,
-                     __func__, ddb_entry->fw_ddb_index,
-                     ha->port_down_retry_count));
+       if (atomic_read(&ddb_entry->state) != DDB_STATE_ONLINE) {
+               atomic_set(&ddb_entry->state, DDB_STATE_DEAD);
 
-       atomic_set(&ddb_entry->state, DDB_STATE_DEAD);
+               DEBUG2(printk("scsi%ld: %s: index [%d] port down retry count "
+                             "of (%d) secs exhausted, marking device DEAD.\n",
+                             ha->host_no, __func__, ddb_entry->fw_ddb_index,
+                             ha->port_down_retry_count));
 
-       DEBUG2(printk("scsi%ld: %s: scheduling dpc routine - dpc flags = "
-                     "0x%lx\n", ha->host_no, __func__, ha->dpc_flags));
-       queue_work(ha->dpc_thread, &ha->dpc_work);
+               DEBUG2(printk("scsi%ld: %s: scheduling dpc routine - dpc "
+                             "flags = 0x%lx\n",
+                             ha->host_no, __func__, ha->dpc_flags));
+               queue_work(ha->dpc_thread, &ha->dpc_work);
+       }
 }
 
 static int qla4xxx_host_get_param(struct Scsi_Host *shost,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to