]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.25/patches.fixes/libiscsi-fix-locking-in-eh_device_reset
Reenabled linux-xen and xen-image build
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.fixes / libiscsi-fix-locking-in-eh_device_reset
CommitLineData
00e5a55c
BS
1From: Mike Christie <michaelc@cs.wisc.edu>
2Date: Wed Sep 24 11:46:15 2008 -0500
3Subject: fix locking in iscsi_eh_device_reset
4X-Git: a343914831a8e29d89af3b26495ab1136a9e3153
5References: bnc#498369
6
7We must be using the bh spin locking functions in
8iscsi_eh_device_reset becuase the session lock interacts with
9a thread and softirq.
10
11This patch also fixes up a bogus comment and check in fail_command,
12because no one drops the lock (bnx2i did but it is not going
13upstream yet and there were other refcount changes for that).
14
15Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
16Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
17Signed-off-by: Hannes Reinecke <hare@suse.de>
18
19diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
20index 5aa0db1..801c7cf 100644
21--- a/drivers/scsi/libiscsi.c
22+++ b/drivers/scsi/libiscsi.c
23@@ -404,11 +404,6 @@ static void fail_command(struct iscsi_conn *conn, struct iscsi_task *task,
24 conn->session->queued_cmdsn--;
25 else
26 conn->session->tt->cleanup_task(conn, task);
27- /*
28- * Check if cleanup_task dropped the lock and the command completed,
29- */
30- if (!task->sc)
31- return;
32
33 sc->result = err;
34 if (!scsi_bidi_cmnd(sc))
35@@ -1829,10 +1824,10 @@ int iscsi_eh_device_reset(struct scsi_cmnd *sc)
36
37 iscsi_suspend_tx(conn);
38
39- spin_lock(&session->lock);
40+ spin_lock_bh(&session->lock);
41 fail_all_commands(conn, sc->device->lun, DID_ERROR);
42 conn->tmf_state = TMF_INITIAL;
43- spin_unlock(&session->lock);
44+ spin_unlock_bh(&session->lock);
45
46 iscsi_start_tx(conn);
47 goto done;