Bug#273055: kernel-image-2.6.8-1-686: user-driven unmount -l /media/usbdisk causes ioctl("/dev/sdc", BLKRRPART) to fail
Package: kernel-image-2.6.8-1-686
Severity: normal
hi herbert,
this is quite a serious bug - a user-driven action can cause
kernel-level hotplug events to not be generated.
details are here:
http://www.uwsg.iu.edu/hypermail/linux/kernel/0409.2/1370.html
repro instructions are:
1) install hal, killall hald and run /usr/sbin/hald --verbose=yes --daemon=no
2) insert a USB floppy or a USB Media card
3) mount the floppy or media card (/media/usbdiskN)
4) compile and run this program on the above mountpoint:
#include <stdio.h>
#include <dirent.h>
int main(int argc, char *argv[])
{
opendir(argv[1]);
sleep(3600);
}
5) whilst the program in 4) is still running, REMOVE WITHOUT WARNING
the floppy (or usb media).
HAL will detect the media removal and will automatically perform
a "umount -l /media/usbdiskN" system command for you.
then...
observe lots of warnings every 2 seconds from hald which are caused
by an ioctl("/dev/sdN", BLKRRPART) failing with a "Device or Resource
busy" message.
in other words, someone forgot to deal with opendirs() properly...
the above ioctl is _supposed_ to be generating hotplug events in order
for HAL to proceed to the next step.
because it does not work, HAL cannot react to hotplug events it has not
received, with the consequence that the user can never use that USB
media device again [without killing off the program, above, inserting
the media, removing it and then reinserting it which is just ridiculous].
l.
-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux highfield 2.6.7-selinux1 #7 Wed Sep 8 17:46:33 BST 2004 i686
Locale: LANG=C, LC_CTYPE=C
Reply to: