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