/[linux-patches]/genpatches-2.6/trunk/2.6.14/1461_15.5_sbp2-fix-deadlock.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.14/1461_15.5_sbp2-fix-deadlock.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 328 - (show annotations) (download) (as text)
Tue Mar 14 13:34:17 2006 UTC (14 years, 7 months ago) by johnm
File MIME type: text/x-diff
File size: 1508 byte(s)
2.6.14-11, rebase against local tree
1 From: Stefan Richter <stefanr@s5r6.in-berlin.de>
2 Date: Sun, 26 Feb 2006 23:52:53 +0000 (+0100)
3 Subject: [PATCH] sbp2: fix another deadlock after disconnection
4 X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/chrisw/linux-2.6.15.y.git;a=commitdiff;h=6cbb463db05210e83ddc18cbd92e295f1fefa111
5
6 [PATCH] sbp2: fix another deadlock after disconnection
7
8 sbp2: fix another deadlock after disconnection
9
10 If there were commands enqueued but not completed before an SBP-2 unit
11 was unplugged (or an attempt to reconnect failed), knodemgrd or any
12 process which tried to remove the device would sleep uninterruptibly
13 in blk_execute_rq(). Therefore make sure that all commands are
14 completed when sbp2 retreats.
15
16 Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 Signed-off-by: Chris Wright <chrisw@sous-sol.org>
18 ---
19
20 --- a/drivers/ieee1394/sbp2.c
21 +++ b/drivers/ieee1394/sbp2.c
22 @@ -650,9 +650,15 @@ static int sbp2_remove(struct device *de
23 if (!scsi_id)
24 return 0;
25
26 - /* Trigger shutdown functions in scsi's highlevel. */
27 - if (scsi_id->scsi_host)
28 + if (scsi_id->scsi_host) {
29 + /* Get rid of enqueued commands if there is no chance to
30 + * send them. */
31 + if (!sbp2util_node_is_available(scsi_id))
32 + sbp2scsi_complete_all_commands(scsi_id, DID_NO_CONNECT);
33 + /* scsi_remove_device() will trigger shutdown functions of SCSI
34 + * highlevel drivers which would deadlock if blocked. */
35 scsi_unblock_requests(scsi_id->scsi_host);
36 + }
37 sdev = scsi_id->sdev;
38 if (sdev) {
39 scsi_id->sdev = NULL;

  ViewVC Help
Powered by ViewVC 1.1.20