From: Chris Wright Date: Mon, 27 Feb 2006 21:07:42 +0000 (-0800) Subject: Add spb2 deadlock fix from Stefan Richter X-Git-Tag: v2.6.15.5~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=09b89481ca7e2acce673cec87f3e7847c4d452aa;p=thirdparty%2Fkernel%2Fstable-queue.git Add spb2 deadlock fix from Stefan Richter --- diff --git a/queue/sbp2-fix-another-deadlock-after-disconnection.patch b/queue/sbp2-fix-another-deadlock-after-disconnection.patch new file mode 100644 index 00000000000..1a6789f8476 --- /dev/null +++ b/queue/sbp2-fix-another-deadlock-after-disconnection.patch @@ -0,0 +1,43 @@ +From stable-bounces@linux.kernel.org Sun Feb 26 15:58:24 2006 +Date: Mon, 27 Feb 2006 00:52:53 +0100 (CET) +From: Stefan Richter +To: stable@kernel.org +Cc: linux-kernel@vger.kernel.org +Subject: [PATCH] sbp2: fix another deadlock after disconnection + +sbp2: fix another deadlock after disconnection + +If there were commands enqueued but not completed before an SBP-2 unit +was unplugged (or an attempt to reconnect failed), knodemgrd or any +process which tried to remove the device would sleep uninterruptibly +in blk_execute_rq(). Therefore make sure that all commands are +completed when sbp2 retreats. + +Signed-off-by: Stefan Richter +Signed-off-by: Chris Wright +--- +Same as commit bf637ec3ef4159da3dd156ecf6f6987d8c8c5dae in Linus' tree. + + drivers/ieee1394/sbp2.c | 10 ++++++++-- + 1 files changed, 8 insertions(+), 2 deletions(-) + +--- linux-2.6.15.4.orig/drivers/ieee1394/sbp2.c ++++ linux-2.6.15.4/drivers/ieee1394/sbp2.c +@@ -650,9 +650,15 @@ static int sbp2_remove(struct device *de + if (!scsi_id) + return 0; + +- /* Trigger shutdown functions in scsi's highlevel. */ +- if (scsi_id->scsi_host) ++ if (scsi_id->scsi_host) { ++ /* Get rid of enqueued commands if there is no chance to ++ * send them. */ ++ if (!sbp2util_node_is_available(scsi_id)) ++ sbp2scsi_complete_all_commands(scsi_id, DID_NO_CONNECT); ++ /* scsi_remove_device() will trigger shutdown functions of SCSI ++ * highlevel drivers which would deadlock if blocked. */ + scsi_unblock_requests(scsi_id->scsi_host); ++ } + sdev = scsi_id->sdev; + if (sdev) { + scsi_id->sdev = NULL; diff --git a/queue/series b/queue/series index ccae94f9d1d..b2d484be164 100644 --- a/queue/series +++ b/queue/series @@ -33,3 +33,4 @@ skge-fix-smp-race.patch x86_64-check-for-bad-elf-entry-address.patch fix-a-severe-bug.patch sd-fix-memory-corruption-with-broken-mode-page-headers.patch +sbp2-fix-another-deadlock-after-disconnection.patch