From patchwork Fri Dec 20 20:21:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 304269 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id BF0372C00AA for ; Sat, 21 Dec 2013 07:22:01 +1100 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Vu6a5-0001fB-Bh; Fri, 20 Dec 2013 20:21:57 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Vu6ZO-0001Np-Gf for kernel-team@lists.ubuntu.com; Fri, 20 Dec 2013 20:21:14 +0000 Received: from c-67-160-231-162.hsd1.ca.comcast.net ([67.160.231.162] helo=fourier) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Vu6ZO-00082G-An; Fri, 20 Dec 2013 20:21:14 +0000 Received: from kamal by fourier with local (Exim 4.80) (envelope-from ) id 1Vu6ZM-0005EY-3Z; Fri, 20 Dec 2013 12:21:12 -0800 From: Kamal Mostafa To: James Bottomley Subject: [3.8.y.z extended stable] Patch "[SCSI] enclosure: fix WARN_ON in dual path device removing" has been added to staging queue Date: Fri, 20 Dec 2013 12:21:12 -0800 Message-Id: <1387570872-20086-1-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 1.8.3.2 X-Extended-Stable: 3.8 Cc: Kamal Mostafa , kernel-team@lists.ubuntu.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com This is a note to let you know that I have just added a patch titled [SCSI] enclosure: fix WARN_ON in dual path device removing to the linux-3.8.y-queue branch of the 3.8.y.z extended stable tree which can be found at: http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.8.y-queue This patch is scheduled to be released in version 3.8.13.15. 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.8.y.z tree, see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable Thanks. -Kamal ------ From de40c1cf961bd261417bdf5e6f8a8f33df47341d Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Fri, 15 Nov 2013 14:58:00 -0800 Subject: [SCSI] enclosure: fix WARN_ON in dual path device removing commit a1470c7bf3a4676e62e4c0fb204e339399eb5c59 upstream. Bug report from: wenxiong@linux.vnet.ibm.com 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@linux.vnet.ibm.com Signed-off-by: James Bottomley Signed-off-by: Kamal Mostafa --- drivers/misc/enclosure.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 1.8.3.2 diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c index 00e5fcac8..cbee842 100644 --- a/drivers/misc/enclosure.c +++ b/drivers/misc/enclosure.c @@ -198,6 +198,13 @@ static void enclosure_remove_links(struct enclosure_component *cdev) { 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");