All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Stanislaw Gruszka <sgruszka@redhat.com>,
	Jens Axboe <axboe@kernel.dk>,
	Tim Gardner <tim.gardner@canonical.com>
Subject: [ 04/12] bsg: fix sysfs link remove warning
Date: Mon, 12 Mar 2012 01:20:49 +0100	[thread overview]
Message-ID: <20120312002046.121573243@1wt.eu> (raw)
In-Reply-To: <feb44625a10a45049eddf27890e95d54@local>

2.6.32-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Stanislaw Gruszka <sgruszka@redhat.com>

BugLink: http://bugs.launchpad.net/bugs/946928

We create "bsg" link if q->kobj.sd is not NULL, so remove it only
when the same condition is true.

Fixes:

WARNING: at fs/sysfs/inode.c:323 sysfs_hash_and_remove+0x2b/0x77()
sysfs: can not remove 'bsg', no directory
Call Trace:
  [<c0429683>] warn_slowpath_common+0x6a/0x7f
  [<c0537a68>] ? sysfs_hash_and_remove+0x2b/0x77
  [<c042970b>] warn_slowpath_fmt+0x2b/0x2f
  [<c0537a68>] sysfs_hash_and_remove+0x2b/0x77
  [<c053969a>] sysfs_remove_link+0x20/0x23
  [<c05d88f1>] bsg_unregister_queue+0x40/0x6d
  [<c0692263>] __scsi_remove_device+0x31/0x9d
  [<c069149f>] scsi_forget_host+0x41/0x52
  [<c0689fa9>] scsi_remove_host+0x71/0xe0
  [<f7de5945>] quiesce_and_remove_host+0x51/0x83 [usb_storage]
  [<f7de5a1e>] usb_stor_disconnect+0x18/0x22 [usb_storage]
  [<c06c29de>] usb_unbind_interface+0x4e/0x109
  [<c067a80f>] __device_release_driver+0x6b/0xa6
  [<c067a861>] device_release_driver+0x17/0x22
  [<c067a46a>] bus_remove_device+0xd6/0xe6
  [<c06785e2>] device_del+0xf2/0x137
  [<c06c101f>] usb_disable_device+0x94/0x1a0

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
(cherry picked from commit 37b40adf2d1b4a5e51323be73ccf8ddcf3f15dd3)

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
 block/bsg.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/block/bsg.c b/block/bsg.c
index 7154a7a..e3e3241 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -977,7 +977,8 @@ void bsg_unregister_queue(struct request_queue *q)
 
 	mutex_lock(&bsg_mutex);
 	idr_remove(&bsg_minor_idr, bcd->minor);
-	sysfs_remove_link(&q->kobj, "bsg");
+	if (q->kobj.sd)
+		sysfs_remove_link(&q->kobj, "bsg");
 	device_unregister(bcd->class_dev);
 	bcd->class_dev = NULL;
 	kref_put(&bcd->ref, bsg_kref_release_function);
-- 
1.7.2.1.45.g54fbc




  parent reply	other threads:[~2012-03-12  0:49 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-12  0:20 [ 00/12] 2.6.32.59-longterm review Willy Tarreau
2012-03-12  0:20 ` Willy Tarreau
2012-03-12  0:20 ` [ 01/12] compat: Re-add missing asm/compat.h include to fix compile breakage on s390 Willy Tarreau
2012-03-12  0:20 ` [ 02/12] Remove COMPAT_IA32 support Willy Tarreau
2012-03-12  1:07   ` Ben Hutchings
2012-03-12  2:49     ` Greg KH
2012-03-12  6:30       ` Willy Tarreau
2012-03-12  6:48         ` stripping [PATCH] without losing later tags from mailed patches (Re: [ 02/12] Remove COMPAT_IA32 support) Jonathan Nieder
2012-03-12  8:58           ` Willy Tarreau
2012-03-12 15:20             ` Greg KH
2012-03-12 15:24               ` Willy Tarreau
2012-03-12 16:41                 ` Thomas Rast
2012-03-12 16:53                   ` Willy Tarreau
2012-03-12 16:57                   ` Jonathan Nieder
2012-03-12 18:04                     ` Junio C Hamano
2012-03-12 18:50                       ` Willy Tarreau
2012-03-12 18:54                         ` Jonathan Nieder
2012-03-12 19:17                           ` Willy Tarreau
2012-03-12 21:47                       ` Thomas Rast
2012-03-12 21:56                         ` [PATCH] git-am: error out when seeing -b/--binary Jonathan Nieder
2012-03-12 22:03                           ` Thomas Rast
2012-03-12 22:22                             ` Jonathan Nieder
2012-03-13 15:31                               ` Thomas Rast
2012-03-13 15:42                                 ` Jonathan Nieder
2012-03-13 15:43                                   ` Thomas Rast
2012-03-13 17:31                                 ` Junio C Hamano
2012-03-13 17:51                                   ` Jonathan Nieder
2012-03-13 18:22                                     ` Junio C Hamano
2012-03-13 18:38                                       ` [PATCH] git-am: officially deprecate -b/--binary Junio C Hamano
2012-03-12 22:12                           ` [PATCH] git-am: error out when seeing -b/--binary Junio C Hamano
2012-03-12 21:57                         ` stripping [PATCH] without losing later tags from mailed patches (Re: [ 02/12] Remove COMPAT_IA32 support) Junio C Hamano
2012-03-12 16:40               ` Junio C Hamano
2012-03-12 16:48                 ` Willy Tarreau
2012-03-12 17:57                   ` Junio C Hamano
2012-03-12 18:45                     ` Willy Tarreau
2012-03-12 19:29                       ` Junio C Hamano
2012-03-12 17:12                 ` Greg KH
2012-03-12 18:01                   ` Junio C Hamano
2012-03-12 19:26                     ` Greg KH
2012-03-12 19:51                       ` Junio C Hamano
2012-03-12 20:19                       ` Willy Tarreau
     [not found]                     ` <m38vj5zeo5.fsf_-_@localhost.localdomain>
2012-03-12 21:41                       ` Removing unmaintained scripts Jonathan Nieder
2012-03-13  9:23                         ` Sergio
2012-03-13  9:29                           ` Thomas Rast
2012-03-12 15:25         ` [ 02/12] Remove COMPAT_IA32 support Ben Hutchings
2012-03-12 17:02   ` Arnd Bergmann
2012-03-12 17:14     ` Willy Tarreau
2012-03-12 19:34     ` Ben Hutchings
2012-03-12 19:45       ` Willy Tarreau
2012-03-12  0:20 ` [ 03/12] writeback: fixups for !dirty_writeback_centisecs Willy Tarreau
2012-03-12  0:20 ` Willy Tarreau [this message]
2012-03-12  0:20 ` [ 05/12] eCryptfs: Handle failed metadata read in lookup Willy Tarreau
2012-03-12  0:20 ` [ 06/12] [S390] KEYS: Enable the compat keyctl wrapper on s390x Willy Tarreau
2012-03-12  0:20 ` [ 07/12] cifs: fix dentry refcount leak when opening a FIFO on lookup Willy Tarreau
2012-03-12  0:20 ` [ 08/12] mac80211: zero initialize count field in ieee80211_tx_rate Willy Tarreau
2012-03-12  1:57   ` Ben Hutchings
2012-03-12  4:36     ` Mohammed Shafi Shajakhan
2012-03-12  6:34       ` Willy Tarreau
2012-03-12  6:52         ` Mohammed Shafi Shajakhan
2012-03-12 15:23           ` Ben Hutchings
2012-03-12 15:55             ` Mohammed Shafi Shajakhan
2012-03-12 16:10               ` Mohammed Shafi Shajakhan
2012-03-12  6:31     ` Willy Tarreau
2012-03-12  0:20 ` [ 09/12] net/usbnet: avoid recursive locking in usbnet_stop() Willy Tarreau
2012-03-12  0:20 ` [ 10/12] regset: Prevent null pointer reference on readonly regsets Willy Tarreau
2012-03-12  0:20 ` [ 11/12] regset: Return -EFAULT, not -EIO, on host-side memory fault Willy Tarreau
2012-03-12  0:20 ` [ 12/12] watchdog: hpwdt: clean up set_memory_x call for 32 bit Willy Tarreau

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=20120312002046.121573243@1wt.eu \
    --to=w@1wt.eu \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sgruszka@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=tim.gardner@canonical.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.