Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6fcc47111ae14f284007e1b9a5002babb01d913c
Commit:     6fcc47111ae14f284007e1b9a5002babb01d913c
Parent:     19966769f9fc1968dcf5bffec2e53f7f40100872
Author:     Swen Schillig <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 7 13:17:57 2007 +0100
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Sat Feb 10 13:11:14 2007 -0600

    [SCSI] zfcp: Invalid locking order
    
    Invalid locking order. Kernel hangs after trying to take two locks
    which are dependend on each other. Introducing temporary variable
    to free requests. Free lock after requests are copied.
    
    Signed-off-by: Swen Schillig <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
---
 drivers/s390/scsi/zfcp_ext.h |    2 +-
 drivers/s390/scsi/zfcp_fsf.c |   23 ++++++++++-------------
 2 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h
index b8794d7..7ec8e35 100644
--- a/drivers/s390/scsi/zfcp_ext.h
+++ b/drivers/s390/scsi/zfcp_ext.h
@@ -89,7 +89,7 @@ extern int  zfcp_fsf_control_file(struct zfcp_adapter *, 
struct zfcp_fsf_req **,
                                  u32, u32, struct zfcp_sg_list *);
 extern void zfcp_fsf_start_timer(struct zfcp_fsf_req *, unsigned long);
 extern void zfcp_erp_start_timer(struct zfcp_fsf_req *);
-extern int  zfcp_fsf_req_dismiss_all(struct zfcp_adapter *);
+extern void zfcp_fsf_req_dismiss_all(struct zfcp_adapter *);
 extern int  zfcp_fsf_status_read(struct zfcp_adapter *, int);
 extern int zfcp_fsf_req_create(struct zfcp_adapter *, u32, int, mempool_t *,
                               unsigned long *, struct zfcp_fsf_req **);
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 067f151..eabf86b 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -176,28 +176,25 @@ static void zfcp_fsf_req_dismiss(struct zfcp_adapter 
*adapter,
 /**
  * zfcp_fsf_req_dismiss_all - dismiss all remaining fsf requests
  */
-int zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter)
+void zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter)
 {
        struct zfcp_fsf_req *request, *tmp;
        unsigned long flags;
+       LIST_HEAD(remove_queue);
        unsigned int i, counter;
 
        spin_lock_irqsave(&adapter->req_list_lock, flags);
        atomic_set(&adapter->reqs_active, 0);
-       for (i=0; i<REQUEST_LIST_SIZE; i++) {
-               if (list_empty(&adapter->req_list[i]))
-                       continue;
-
-               counter = 0;
-               list_for_each_entry_safe(request, tmp,
-                                        &adapter->req_list[i], list) {
-                       zfcp_fsf_req_dismiss(adapter, request, counter);
-                       counter++;
-               }
-       }
+       for (i=0; i<REQUEST_LIST_SIZE; i++)
+               list_splice_init(&adapter->req_list[i], &remove_queue);
+
        spin_unlock_irqrestore(&adapter->req_list_lock, flags);
 
-       return 0;
+       counter = 0;
+       list_for_each_entry_safe(request, tmp, &remove_queue, list) {
+               zfcp_fsf_req_dismiss(adapter, request, counter);
+               counter++;
+       }
 }
 
 /*
-
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