sysfs: can not remove 'bsg', no directory

Bug #946928 reported by Jean-Louis Dupond
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Medium
Tim Gardner
Hardy
Fix Released
Undecided
Tim Gardner
Lucid
Fix Released
Undecided
Tim Gardner
Maverick
Won't Fix
Undecided
Tim Gardner
Natty
Fix Released
Undecided
Tim Gardner
Oneiric
Fix Released
Undecided
Tim Gardner
Precise
Fix Released
Medium
Tim Gardner

Bug Description

Suddenly got this warning in dmesg:
Mar 4 23:08:39 laptop-jl kernel: [19951.767731] ------------[ cut here ]------------
Mar 4 23:08:39 laptop-jl kernel: [19951.767751] WARNING: at /build/buildd/linux-3.2.0/fs/sysfs/inode.c:323 sysfs_hash_and_remove+0xa9/0xb0()
Mar 4 23:08:39 laptop-jl kernel: [19951.767759] Hardware name: Dell System XPS L502X
Mar 4 23:08:39 laptop-jl kernel: [19951.767764] sysfs: can not remove 'bsg', no directory
Mar 4 23:08:39 laptop-jl kernel: [19951.767769] Modules linked in: xfs ses enclosure dm_crypt nls_iso8859_1 nls_cp437 vfat fat usb_storage ip6table_filter ip6_tables ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack ipt_REJECT xt_CHECKSUM iptable_mangle xt_tcpudp iptable_filter ip_tables x_tables bridge stp bbswitch(O) bnep rfcomm parport_pc ppdev nfsd nfs binfmt_misc lockd fscache auth_rpcgss nfs_acl sunrpc snd_hda_codec_hdmi snd_hda_codec_realtek joydev arc4 dell_wmi sparse_keymap cdc_ether cdc_wdm usbnet cdc_acm snd_hda_intel snd_hda_codec snd_hwdep dell_laptop dcdbas snd_pcm snd_seq_midi snd_rawmidi snd_seq_midi_event btusb bluetooth snd_seq uvcvideo psmouse videodev serio_raw v4l2_compat_ioctl32 snd_timer snd_seq_device iwlwifi snd mac80211 cfg80211 soundcore snd_page_alloc ttm mxm_wmi wmi i915 drm_kms_helper mei(C) drm mac_hid i2c_algo_bit video lp parport usbhid hid r8169 [last unloaded: nouveau]
Mar 4 23:08:39 laptop-jl kernel: [19951.767986] Pid: 47, comm: khubd Tainted: G WC O 3.2.0-17-generic #27-Ubuntu
Mar 4 23:08:39 laptop-jl kernel: [19951.767993] Call Trace:
Mar 4 23:08:39 laptop-jl kernel: [19951.768012] [<ffffffff8106723f>] warn_slowpath_common+0x7f/0xc0
Mar 4 23:08:39 laptop-jl kernel: [19951.768024] [<ffffffff81067336>] warn_slowpath_fmt+0x46/0x50
Mar 4 23:08:39 laptop-jl kernel: [19951.768035] [<ffffffff811ea869>] sysfs_hash_and_remove+0xa9/0xb0
Mar 4 23:08:39 laptop-jl kernel: [19951.768048] [<ffffffff811ecf66>] sysfs_remove_link+0x26/0x30
Mar 4 23:08:39 laptop-jl kernel: [19951.768062] [<ffffffff812fa13c>] bsg_unregister_queue+0x4c/0x90
Mar 4 23:08:39 laptop-jl kernel: [19951.768078] [<ffffffff8142b4d9>] __scsi_remove_device+0xa9/0xd0
Mar 4 23:08:39 laptop-jl kernel: [19951.768089] [<ffffffff81429e64>] scsi_forget_host+0x64/0x70
Mar 4 23:08:39 laptop-jl kernel: [19951.768103] [<ffffffff8141f05f>] scsi_remove_host+0x6f/0x120
Mar 4 23:08:39 laptop-jl kernel: [19951.768122] [<ffffffffa021a72d>] quiesce_and_remove_host+0x6d/0xc0 [usb_storage]
Mar 4 23:08:39 laptop-jl kernel: [19951.768138] [<ffffffffa021a7a2>] usb_stor_disconnect+0x22/0x40 [usb_storage]
Mar 4 23:08:39 laptop-jl kernel: [19951.768153] [<ffffffff81494a82>] usb_unbind_interface+0x52/0x180
Mar 4 23:08:39 laptop-jl kernel: [19951.768168] [<ffffffff813f1afc>] __device_release_driver+0x7c/0xe0
Mar 4 23:08:39 laptop-jl kernel: [19951.768180] [<ffffffff813f1b8c>] device_release_driver+0x2c/0x40
Mar 4 23:08:39 laptop-jl kernel: [19951.768192] [<ffffffff813f1638>] bus_remove_device+0x78/0xb0
Mar 4 23:08:39 laptop-jl kernel: [19951.768203] [<ffffffff813eec0d>] device_del+0x12d/0x1b0
Mar 4 23:08:39 laptop-jl kernel: [19951.768214] [<ffffffff814927af>] usb_disable_device+0xaf/0x1d0
Mar 4 23:08:39 laptop-jl kernel: [19951.768227] [<ffffffff8148b4e8>] usb_disconnect+0x98/0x140
Mar 4 23:08:39 laptop-jl kernel: [19951.768241] [<ffffffff8148c350>] hub_port_connect_change+0xa0/0x6e0
Mar 4 23:08:39 laptop-jl kernel: [19951.768254] [<ffffffff81489a7a>] ? hub_port_finish_reset.isra.17+0x6a/0x140
Mar 4 23:08:39 laptop-jl kernel: [19951.768267] [<ffffffff8148ce54>] hub_events+0x4c4/0x620
Mar 4 23:08:39 laptop-jl kernel: [19951.768282] [<ffffffff816566bc>] ? __schedule+0x3cc/0x6f0
Mar 4 23:08:39 laptop-jl kernel: [19951.768295] [<ffffffff8148cfe5>] hub_thread+0x35/0x180
Mar 4 23:08:39 laptop-jl kernel: [19951.768303] [<ffffffff8108ae20>] ? add_wait_queue+0x60/0x60
Mar 4 23:08:39 laptop-jl kernel: [19951.768312] [<ffffffff8148cfb0>] ? hub_events+0x620/0x620
Mar 4 23:08:39 laptop-jl kernel: [19951.768319] [<ffffffff8108a38c>] kthread+0x8c/0xa0
Mar 4 23:08:39 laptop-jl kernel: [19951.768329] [<ffffffff81663374>] kernel_thread_helper+0x4/0x10
Mar 4 23:08:39 laptop-jl kernel: [19951.768337] [<ffffffff8108a300>] ? flush_kthread_worker+0xa0/0xa0
Mar 4 23:08:39 laptop-jl kernel: [19951.768345] [<ffffffff81663370>] ? gs_change+0x13/0x13
Mar 4 23:08:39 laptop-jl kernel: [19951.768350] ---[ end trace 3cfa9e8ed85c7a33 ]---

There is already a fix for this in kernel GIT:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=commitdiff;h=37b40adf2d1b4a5e51323be73ccf8ddcf3f15dd3

Could this be applied in Precise kernel?

Andy Whitcroft (apw)
Changed in linux (Ubuntu):
status: New → Incomplete
status: Incomplete → Triaged
Changed in linux (Ubuntu):
importance: Undecided → Medium
tags: added: precise
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

This patch is already applied in the Precise kernel as commit:
37b40adf2d1b4a5e51323be73ccf8ddcf3f15dd3

Can you test with the latest kernel (3.2.0-18.28) to confirm this bug is resolved? If it is, please mark this bug as "Fix Released"

tags: added: kernel-da-key
Revision history for this message
Jean-Louis Dupond (dupondje) wrote :
Changed in linux (Ubuntu Precise):
status: Triaged → Fix Committed
Revision history for this message
Tim Gardner (timg-tpi) wrote :

cherry-picked 37b40adf2d1b4a5e51323be73ccf8ddcf3f15dd3 'bsg: fix sysfs link remove warning'

Changed in linux (Ubuntu Precise):
assignee: nobody → Tim Gardner (timg-tpi)
Tim Gardner (timg-tpi)
Changed in linux (Ubuntu Lucid):
status: New → Fix Committed
Changed in linux (Ubuntu Maverick):
status: New → Fix Committed
Changed in linux (Ubuntu Natty):
status: New → Fix Committed
Changed in linux (Ubuntu Oneiric):
status: New → Fix Committed
Revision history for this message
Tim Gardner (timg-tpi) wrote :

SRU Justification

Impact: a WARNING message is printed in the kernel log and some resources are orphaned.

Patch Description: Check that the kobject has a sysfs entry and remove it on unregistration.

Changed in linux (Ubuntu Hardy):
status: New → Fix Committed
Tim Gardner (timg-tpi)
Changed in linux (Ubuntu Oneiric):
assignee: nobody → Tim Gardner (timg-tpi)
Changed in linux (Ubuntu Natty):
assignee: nobody → Tim Gardner (timg-tpi)
Changed in linux (Ubuntu Maverick):
assignee: nobody → Tim Gardner (timg-tpi)
Changed in linux (Ubuntu Lucid):
assignee: nobody → Tim Gardner (timg-tpi)
Changed in linux (Ubuntu Hardy):
assignee: nobody → Tim Gardner (timg-tpi)
Revision history for this message
Herton R. Krzesinski (herton) wrote :

This bug is awaiting verification that the kernel Hardy in -proposed solves the problem (2.6.24-31.100). Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-hardy' to 'verification-done-hardy'.

If verification is not done by one week from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-hardy
Revision history for this message
Tim Gardner (timg-tpi) wrote :

This patch is on the stable updates queue for 2.6.32.y, 3.0.y, and 3.2.y. This patch is a clean cherry-pick for Lucid and newer. Hardy is a minor backport, so I think we can assume verification-done.

tags: added: verification-done-hardy
removed: verification-needed-hardy
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 3.2.0-18.29

---------------
linux (3.2.0-18.29) precise; urgency=low

  [ Andy Whitcroft ]

  * [Config] restore build-% shortcut
  * SAUCE: ata_piix: defer disks to the Hyper-V drivers by default
    - LP: #929545, #942316

  [ Eugeni Dodonov ]

  * SAUCE: drm: give up on edid retries when i2c bus is not responding
    - LP: #855124

  [ Seth Forshee ]

  * SAUCE: (drop after 3.3) platform/x86: Add driver for Apple gmux device
    - LP: #925544

  [ Upstream Kernel Changes ]

  * bsg: fix sysfs link remove warning
    - LP: #946928
  * regset: Prevent null pointer reference on readonly regsets
    - LP: #949905
    - CVE-2012-1097
  * regset: Return -EFAULT, not -EIO, on host-side memory fault
    - LP: #949905
    - CVE-2012-1097

  [ Wu Fengguang ]

  * SAUCE: (drop after 3.4) ALSA: hda - add id for Atom Cedar Trail HDMI
    codec
 -- Leann Ogasawara <email address hidden> Fri, 09 Mar 2012 07:56:11 -0800

Changed in linux (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Luis Henriques (henrix) wrote :

This bug is awaiting verification that the kernel for Oneiric in -proposed solves the problem ( 3.0.0-17.30). Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-oneiric' to 'verification-done-oneiric'.

If verification is not done by one week from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-oneiric
Revision history for this message
Luis Henriques (henrix) wrote :

As Tim referred in comment #6, this patch is queued for stable so its safe to assume verification-done.

tags: added: verification-done-oneiric
removed: verification-needed-oneiric
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (6.6 KiB)

This bug was fixed in the package linux - 3.0.0-17.30

---------------
linux (3.0.0-17.30) oneiric-proposed; urgency=low

  [Luis Henriques]

  * Release Tracking Bug
    - LP: #949882

  [ Andy Whitcroft ]

  * [Config] restore build-% shortcut

  [ Stefan Bader ]

  * (config) Fix virtual flavour inclusion of xen-kbdfront
    - LP: #944582

  [ Upstream Kernel Changes ]

  * readahead: fix pipeline break caused by block plug
    - LP: #931719
  * ALSA: HDA: Fix duplicated output to more than one codec
    - LP: #924320, #931719
  * ASoC: wm_hubs: Enable line out VMID buffer for single ended line
    outputs
    - LP: #931719
  * ASoC: wm_hubs: fix wrong bits for LINEOUT2 N/P mixer
    - LP: #931719
  * ARM: 7306/1: vfp: flush thread hwstate before restoring context from
    sigframe
    - LP: #931719
  * ARM: 7307/1: vfp: fix ptrace regset modification race
    - LP: #931719
  * ARM: 7308/1: vfp: flush thread hwstate before copying ptrace registers
    - LP: #931719
  * ARM: OMAP2+: GPMC: fix device size setup
    - LP: #931719
  * drivers/tty/vt/vt_ioctl.c: fix KDFONTOP 32bit compatibility layer
    - LP: #931719
  * proc: mem_release() should check mm != NULL
    - LP: #931719
  * proc: unify mem_read() and mem_write()
    - LP: #931719
  * proc: make sure mem_open() doesn't pin the target's memory
    - LP: #931719
  * firewire: ohci: add reset packet quirk for SB Audigy
    - LP: #931719
  * firewire: ohci: disable MSI on Ricoh controllers
    - LP: #931719
  * IB/mlx4: pass SMP vendor-specific attribute MADs to firmware
    - LP: #931719
  * kprobes: fix a memory leak in function pre_handler_kretprobe()
    - LP: #931719
  * at_hdmac: bugfix for enabling channel irq
    - LP: #931719
  * mm/filemap_xip.c: fix race condition in xip_file_fault()
    - LP: #931719
  * mm: compaction: check pfn_valid when entering a new MAX_ORDER_NR_PAGES
    block during isolation for migration
    - LP: #931719
  * drm/radeon: Set DESKTOP_HEIGHT register to the framebuffer (not mode)
    height.
    - LP: #931719
  * drm/nouveau/gem: fix fence_sync race / oops
    - LP: #931719
  * drm/radeon/kms: disable output polling when suspended
    - LP: #931719
  * sched/rt: Fix task stack corruption under
    __ARCH_WANT_INTERRUPTS_ON_CTXSW
    - LP: #931719
  * ASoC: Ensure we generate a driver name
    - LP: #931719
  * udf: Mark LVID buffer as uptodate before marking it dirty
    - LP: #931719
  * drm/i915: HDMI hot remove notification to audio driver
    - LP: #931719
  * drm/i915: DisplayPort hot remove notification to audio driver
    - LP: #931719
  * drm/i915: check ACTHD of all rings
    - LP: #931719
  * drm/i915: Fix TV Out refresh rate.
    - LP: #931719
  * drm/i915: handle 3rd pipe
    - LP: #931719
  * eCryptfs: Infinite loop due to overflow in ecryptfs_write()
    - LP: #931719
  * cifs: Fix oops in session setup code for null user mounts
    - LP: #931719
  * atmel_lcdfb: fix usage of CONTRAST_CTR in suspend/resume
    - LP: #931719
  * lockdep, bug: Exclude TAINT_FIRMWARE_WORKAROUND from disabling lockdep
    - LP: #931719
  * hwmon: (w83627ehf) Fix number of fans for NCT6776F
    - LP: #931719
  * ASoC: wm_hubs: Fix routing of input PGAs to li...

Read more...

Changed in linux (Ubuntu Oneiric):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 2.6.24-31.100

---------------
linux (2.6.24-31.100) hardy-proposed; urgency=low

  [Herton R. Krzesinski]

  * Release Tracking Bug
    - LP: #948393

  [Upstream Kernel Changes]

  * bsg: fix sysfs link remove warning
    - LP: #946928
 -- Herton Ronaldo Krzesinski <email address hidden> Tue, 06 Mar 2012 17:41:15 -0300

Changed in linux (Ubuntu Hardy):
status: Fix Committed → Fix Released
Revision history for this message
Luis Henriques (henrix) wrote :

The commit for this issue came in via a stable upstream release. As such it is not subject to the standard bug verification process.

tags: added: verification-done-lucid
Luis Henriques (henrix)
tags: added: verification-done-maverick
tags: added: verification-done-natty
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 2.6.38-14.58

---------------
linux (2.6.38-14.58) natty-proposed; urgency=low

  [Luis Henriques]

  * Release Tracking Bug
    - LP: #965346

  [ Andy Whitcroft ]

  * [Config] restore build-% shortcut

  [ Upstream Kernel Changes ]

  * eCryptfs: Make truncate path killable
    - LP: #947270
  * bsg: fix sysfs link remove warning
    - LP: #946928
  * regset: Prevent null pointer reference on readonly regsets
    - LP: #949905
    - CVE-2012-1097
  * regset: Return -EFAULT, not -EIO, on host-side memory fault
    - LP: #949905
    - CVE-2012-1097
  * mm: memcg: Correct unregistring of events attached to the same eventfd
    - LP: #952828
    - CVE-2012-1146
  * KVM: Remove ability to assign a device without iommu support
    - LP: #897812
    - CVE-2011-4347
  * eCryptfs: Copy up lower inode attrs after setting lower xattr
  * eCryptfs: Handle failed metadata read in lookup
    - LP: #509180
  * eCryptfs: Improve statfs reporting
    - LP: #885744
  * KVM: x86: extend "struct x86_emulate_ops" with "get_cpuid"
    - LP: #917842
    - CVE-2012-0045
  * KVM: x86: fix missing checks in syscall emulation
    - LP: #917842
    - CVE-2012-0045
 -- Luis Henriques <email address hidden> Mon, 26 Mar 2012 15:28:22 +0100

Changed in linux (Ubuntu Natty):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (4.8 KiB)

This bug was fixed in the package linux - 2.6.32-41.88

---------------
linux (2.6.32-41.88) lucid-proposed; urgency=low

  [Luis Henriques]

  * Release Tracking Bug
    - LP: #966443

  [ Andy Whitcroft ]

  * [Config] restore build-% shortcut

  [ Tim Gardner ]

  * SAUCE: ubuntu drivers: use UMH_WAIT_PROC consistently
    - LP: #963685

  [ Upstream Kernel Changes ]

  * Revert "Revert "USB: xhci - fix unsafe macro definitions""
    - LP: #948139
  * Revert "Revert "USB: xhci - fix math in xhci_get_endpoint_interval()""
    - LP: #948139
  * Revert "Revert "xhci: Fix full speed bInterval encoding.""
    - LP: #948139
  * bsg: fix sysfs link remove warning
    - LP: #946928
  * hwmon: (f75375s) Fix bit shifting in f75375_write16
    - LP: #948139
  * lib: proportion: lower PROP_MAX_SHIFT to 32 on 64-bit kernel
    - LP: #948139
  * relay: prevent integer overflow in relay_open()
    - LP: #948139
  * mac80211: timeout a single frame in the rx reorder buffer
    - LP: #948139
  * kernel.h: fix wrong usage of __ratelimit()
    - LP: #948139
  * printk_ratelimited(): fix uninitialized spinlock
    - LP: #948139
  * hwmon: (f75375s) Fix automatic pwm mode setting for F75373 & F75375
    - LP: #948139
  * crypto: sha512 - Use binary and instead of modulus
    - LP: #948139
  * crypto: sha512 - Avoid stack bloat on i386
    - LP: #948139
  * crypto: sha512 - use standard ror64()
    - LP: #948139
  * SCSI: 3w-9xxx fix bug in sgl loading
    - LP: #948139
  * ARM: 7321/1: cache-v7: Disable preemption when reading CCSIDR
    - LP: #948139
  * ARM: 7325/1: fix v7 boot with lockdep enabled
    - LP: #948139
  * USB: Added Kamstrup VID/PIDs to cp210x serial driver.
    - LP: #948139
  * USB: Fix handoff when BIOS disables host PCI device.
    - LP: #948139
  * xhci: Fix encoding for HS bulk/control NAK rate.
    - LP: #948139
  * hdpvr: fix race conditon during start of streaming
    - LP: #948139
  * cdrom: use copy_to_user() without the underscores
    - LP: #948139
  * autofs: work around unhappy compat problem on x86-64
    - LP: #948139
  * Fix autofs compile without CONFIG_COMPAT
    - LP: #948139
  * compat: fix compile breakage on s390
    - LP: #948139
  * PM: Print a warning if firmware is requested when tasks are frozen
    - LP: #948139
  * firmware loader: allow builtin firmware load even if usermodehelper is
    disabled
    - LP: #948139
  * PM / Sleep: Fix freezer failures due to racy
    usermodehelper_is_disabled()
    - LP: #948139
  * PM / Sleep: Fix read_unlock_usermodehelper() call.
    - LP: #948139
  * Linux 2.6.32.58
    - LP: #948139
  * regset: Prevent null pointer reference on readonly regsets
    - LP: #949905
    - CVE-2012-1097
  * regset: Return -EFAULT, not -EIO, on host-side memory fault
    - LP: #949905
    - CVE-2012-1097
  * KVM: Remove ability to assign a device without iommu support
    - LP: #897812
    - CVE-2011-4347
  * eCryptfs: Copy up lower inode attrs after setting lower xattr
  * eCryptfs: Improve statfs reporting
    - LP: #885744
  * drm/i915: no lvds quirk for AOpen MP45
    - LP: #955078
  * drm/radeon/kms: fix MSI re-arm on rv370+
    - LP: #955078
  * Linux 2.6.32.58+drm33.24
    - LP: #955078
  ...

Read more...

Changed in linux (Ubuntu Lucid):
status: Fix Committed → Fix Released
Tim Gardner (timg-tpi)
Changed in linux (Ubuntu Maverick):
status: Fix Committed → Won't Fix
Revision history for this message
Adam Conrad (adconrad) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.