summaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_fsf.c
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2007-02-07 13:17:57 +0100
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-02-10 13:11:14 -0600
commit6fcc47111ae14f284007e1b9a5002babb01d913c (patch)
tree71fbe20f7c69a7e93b239cc22a13bbc05936d024 /drivers/s390/scsi/zfcp_fsf.c
parent19966769f9fc1968dcf5bffec2e53f7f40100872 (diff)
downloadblackbird-op-linux-6fcc47111ae14f284007e1b9a5002babb01d913c.tar.gz
blackbird-op-linux-6fcc47111ae14f284007e1b9a5002babb01d913c.zip
[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 <swen@vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_fsf.c')
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 067f1519eb04..eabf86bb13f5 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++;
+ }
}
/*
OpenPOWER on IntegriCloud