No uevent when loop devices get removed

Bug #554330 reported by Dave Gilbert
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: udisks

I'm seeing some partitions persist even after I've removed them.

In this case today I used a loopback filesystem (setup with a mount -o loop) from a file that happened to be on a mounted
thumb drive (it was the -rw backing store of a bootable usb); but even though I've unmounted it and losetup -a doesn't show it,
udisks --enumerate still shows:

/org/freedesktop/UDisks/devices/loop0

and my disk mounter applet still shows an icon that I think corresponds to it.

The following is a section of a udisks --dump; note I can see that /dev/disk/by-uuid still has the entry linking to ../../loop0.

I also saw a couple of days ago a situation where the main partition of a thumb drive was still shown after removing it; but
I didn't take any debug at that time.

========================================================================
Showing information for /org/freedesktop/UDisks/devices/loop0
  native-path: /sys/devices/virtual/block/loop0
  device: 7:0
  device-file: /dev/loop0
    presentation: /dev/loop0
    by-id: /dev/disk/by-uuid/7080535a-eda4-49e0-bb52-ac425faeb859
  detected at: Fri 02 Apr 2010 22:37:29 BST
  system internal: 1
  removable: 0
  has media: 1 (detected at Fri 02 Apr 2010 22:37:29 BST)
    detects change: 0
    detection by polling: 0
    detection inhibitable: 0
    detection inhibited: 0
  is read only: 0
  is mounted: 0
  mount paths:
  mounted by uid: 0
  presentation hide: 0
  presentation nopolicy: 1
  presentation name:
  presentation icon:
  size: 3047161856
  block size: 512
  job underway: no
  usage: filesystem
  type: ext3
  version: 1.0
  uuid: 7080535a-eda4-49e0-bb52-ac425faeb859
  label:
  loop:
    filename: /media/3C74-BC4B/casper-rw
  drive:
    vendor: Linux
    model: Loop: casper-rw
    revision:
    serial:
    WWN:
    detachable: 0
    can spindown: 0
    rotational media: Yes, unknown rate
    write-cache: unknown
    ejectable: 0
    adapter: Unknown
    ports:
    similar devices:
    media:
      compat:
    interface: (unknown)
    if speed: (unknown)
    ATA SMART: not available

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: udisks 1.0.0+git20100319-0git1
ProcVersionSignature: Ubuntu 2.6.32-19.28-generic 2.6.32.10+drm33.1
Uname: Linux 2.6.32-19-generic x86_64
Architecture: amd64
CheckboxSubmission: f2d10bd9f943a85b486a282e7840a570
CheckboxSystem: 0531969bcfd4f03af7405c98dc94a948
Date: Sat Apr 3 01:07:30 2010
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
MachineType: To Be Filled By O.E.M. To Be Filled By O.E.M.
ProcCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.32-19-generic root=UUID=d8314979-8ace-401c-88df-728ad6b89cb5 ro ignore_loglevel netconsole=4444@192.168.66.33/eth0,514@192.168.66.25/00:a0:d1:63:68:a6 quiet splash
ProcEnviron:
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: udisks
dmi.bios.date: 09/10/2009
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: P1.50
dmi.board.name: P55M Pro
dmi.board.vendor: ASRock
dmi.chassis.asset.tag: To Be Filled By O.E.M.
dmi.chassis.type: 3
dmi.chassis.vendor: To Be Filled By O.E.M.
dmi.chassis.version: To Be Filled By O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrP1.50:bd09/10/2009:svnToBeFilledByO.E.M.:pnToBeFilledByO.E.M.:pvrToBeFilledByO.E.M.:rvnASRock:rnP55MPro:rvr:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:
dmi.product.name: To Be Filled By O.E.M.
dmi.product.version: To Be Filled By O.E.M.
dmi.sys.vendor: To Be Filled By O.E.M.

Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :
Revision history for this message
Phillip Susi (psusi) wrote :

Noticed the same thing tonight. I used the usb startup disk creator last night, which apparently mounted the iso image via loop0, and it is still showing in my computer in nautilus despite the fact that /dev/loop0 no longer exists, and I have even deleted the iso file.

I even killed udisks-daemon and restared it so it does not show up in udisks --dump, but it's still showing in nautilus.

Changed in udisks (Ubuntu):
status: New → Confirmed
tags: added: regression-potential
Phillip Susi (psusi)
Changed in udisks (Ubuntu):
importance: Undecided → Low
Revision history for this message
Martin Pitt (pitti) wrote :

This is actually a bug in the kernel, since it fails to generate an uevent if a loop device is detached or removed.

David Zeuthen sent a patch for this a while ago: http://people.freedesktop.org/~david/0001-Generate-change-uevent-for-loop-device.patch, but it seems that didn't land upstream yet.

affects: udisks (Ubuntu) → linux (Ubuntu)
Changed in linux (Ubuntu):
status: Confirmed → Triaged
summary: - loopbacks persisting in udisks even when they're gone
+ No uevent when loop devices get removed
Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :

I can see the patch is in the current ubuntu kernel git.
and I just did:
losetup -f aloopbackfile
mount /dev/loop0 /mnt
umount /mnt
losetup -d /dev/loop0

and the icon disappeared and it doesn't appear in udisks --enumerate any more.

Looks good.

Changed in linux (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :

Oops, should have said that the test was done on 2.6.35-22-generic #34-Ubuntu SMP in current maverick.

Dave

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.