Patch "SCSI: enclosure: fix WARN_ON in dual path device removing" has been added to the 3.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    SCSI: enclosure: fix WARN_ON in dual path device removing

to the 3.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     scsi-enclosure-fix-warn_on-in-dual-path-device-removing.patch
and it can be found in the queue-3.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From a1470c7bf3a4676e62e4c0fb204e339399eb5c59 Mon Sep 17 00:00:00 2001
From: James Bottomley <JBottomley@xxxxxxxxxxxxx>
Date: Fri, 15 Nov 2013 14:58:00 -0800
Subject: SCSI: enclosure: fix WARN_ON in dual path device removing

From: James Bottomley <JBottomley@xxxxxxxxxxxxx>

commit a1470c7bf3a4676e62e4c0fb204e339399eb5c59 upstream.

Bug report from: wenxiong@xxxxxxxxxxxxxxxxxx

The issue is happened in dual controller configuration. We got the
sysfs warnings when rmmod the ipr module.

enclosure_unregister() in drivers/msic/enclosure.c, call device_unregister()
for each componment deivce, device_unregister() ->device_del()->kobject_del()
->sysfs_remove_dir(). In sysfs_remove_dir(), set kobj->sd = NULL.

For each componment device,
enclosure_component_release()->enclosure_remove_links()->sysfs_remove_link()
in which checking kobj->sd again, it has been set as NULL when doing
device_unregister. So we saw all these sysfs WARNING.

Tested-by: wenxiong@xxxxxxxxxxxxxxxxxx
Signed-off-by: James Bottomley <JBottomley@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 drivers/misc/enclosure.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/drivers/misc/enclosure.c
+++ b/drivers/misc/enclosure.c
@@ -198,6 +198,13 @@ static void enclosure_remove_links(struc
 {
 	char name[ENCLOSURE_NAME_SIZE];
 
+	/*
+	 * In odd circumstances, like multipath devices, something else may
+	 * already have removed the links, so check for this condition first.
+	 */
+	if (!cdev->dev->kobj.sd)
+		return;
+
 	enclosure_link_name(cdev, name);
 	sysfs_remove_link(&cdev->dev->kobj, name);
 	sysfs_remove_link(&cdev->cdev.kobj, "device");


Patches currently in stable-queue which might be from JBottomley@xxxxxxxxxxxxx are

queue-3.10/scsi-libsas-fix-usage-of-ata_tf_to_fis.patch
queue-3.10/scsi-hpsa-do-not-discard-scsi-status-on-aborted-commands.patch
queue-3.10/scsi-hpsa-return-0-from-driver-probe-function-on-success-not-1.patch
queue-3.10/scsi-bfa-fix-crash-when-symb-name-set-for-offline-vport.patch
queue-3.10/scsi-enclosure-fix-warn_on-in-dual-path-device-removing.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]