[3.19.y-ckt stable] Patch "Revert "scsi: fix soft lockup in scsi_remove_target() on module removal"" has been added to the 3.19.y-ckt tree

Kamal Mostafa kamal at canonical.com
Wed Jul 6 21:00:09 UTC 2016

This is a note to let you know that I have just added a patch titled

    Revert "scsi: fix soft lockup in scsi_remove_target() on module removal"

to the linux-3.19.y-queue branch of the 3.19.y-ckt extended stable tree 
which can be found at:


This patch is scheduled to be released in version 3.19.8-ckt23.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.19.y-ckt tree, see



>From 01d6d113fcc3bfbc995c362f961af25deec79c91 Mon Sep 17 00:00:00 2001
From: Johannes Thumshirn <jthumshirn at suse.de>
Date: Tue, 5 Apr 2016 11:50:45 +0200
Subject: Revert "scsi: fix soft lockup in scsi_remove_target() on module

commit 305c2e71b3d733ec065cb716c76af7d554bd5571 upstream.

Now that we've done a more comprehensive fix with the intermediate
target state we can remove the previous hack introduced with commit
90a88d6ef88e ("scsi: fix soft lockup in scsi_remove_target() on module

Signed-off-by: Johannes Thumshirn <jthumshirn at suse.de>
Reviewed-by: Ewan D. Milne <emilne at redhat.com>
Reviewed-by: Hannes Reinecke <hare at suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen at oracle.com>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
 drivers/scsi/scsi_sysfs.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index c6126e0..64f11fa 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -1148,19 +1148,17 @@ static void __scsi_remove_target(struct scsi_target *starget)
 void scsi_remove_target(struct device *dev)
 	struct Scsi_Host *shost = dev_to_shost(dev->parent);
-	struct scsi_target *starget, *last_target = NULL;
+	struct scsi_target *starget;
 	unsigned long flags;

 	spin_lock_irqsave(shost->host_lock, flags);
 	list_for_each_entry(starget, &shost->__targets, siblings) {
 		if (starget->state == STARGET_DEL ||
-		    starget->state == STARGET_REMOVE ||
-		    starget == last_target)
+		    starget->state == STARGET_REMOVE)
 		if (starget->dev.parent == dev || &starget->dev == dev) {
-			last_target = starget;
 			starget->state = STARGET_REMOVE;
 			spin_unlock_irqrestore(shost->host_lock, flags);

More information about the kernel-team mailing list