mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: stable@kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2.6.15.4] sbp2: fix another deadlock after disconnection
Date: Mon, 27 Feb 2006 00:52:53 +0100 (CET)	[thread overview]
Message-ID: <tkrat.efa2081c5664aec6@s5r6.in-berlin.de> (raw)

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 <stefanr@s5r6.in-berlin.de>
---
Same as commit bf637ec3ef4159da3dd156ecf6f6987d8c8c5dae in Linus' tree.

Index: linux-2.6.15.4/drivers/ieee1394/sbp2.c
===================================================================
--- linux-2.6.15.4.orig/drivers/ieee1394/sbp2.c	2006-02-27 00:29:50.000000000 +0100
+++ linux-2.6.15.4/drivers/ieee1394/sbp2.c	2006-02-27 00:31:19.000000000 +0100
@@ -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;



             reply	other threads:[~2006-02-26 23:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-26 23:52 Stefan Richter [this message]
2006-02-27 20:25 ` [stable] " Chris Wright

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tkrat.efa2081c5664aec6@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®