HotPlug Race condition with udevsend
Gregory G Carter
gcarter at aesgi.com
Thu Apr 29 15:50:25 UTC 2004
Small Problem....
I attempted a update/upgrade from test2->test3.
I am now experiencing HotPlug issues...specifically, udevsend appears to
spawning a large number of copies immediately after mounting the USB
file system on boot.
This results with a system that has a load average of about 45.
At this point the little fan in my Sager 5670 starts going into turbo
mode and lifts the laptop 3 feet into the air.
It is now a hovercraft, which I use to hitch a ride to the break room
for a Vanilla Pepsi....but I DIGRESS...
In any case, here is a process list:
root 9136 0.0 0.0 2060 1028 ? S< 10:32 0:00 /bin/sh
/sbin/hotplug scsi_host
root 9145 0.0 0.0 2060 992 ? S< 10:32 0:00 /bin/sh
/sbin/udevsend scsi_host
root 9147 0.0 0.0 2060 1024 ? S< 10:32 0:00 /bin/sh
/sbin/hotplug scsi
root 9161 0.0 0.0 2056 1024 ? S< 10:32 0:00 /bin/sh
/sbin/hotplug block
root 9170 0.0 0.0 2056 992 ? S< 10:32 0:00 /bin/sh
/sbin/udevsend block
root 9172 0.0 0.0 2056 1024 ? S< 10:32 0:00 /bin/sh
/sbin/hotplug block
root 9180 0.0 0.0 2056 1020 ? S< 10:32 0:00 /bin/sh
/sbin/hotplug scsi_device
root 9189 0.0 0.0 2060 996 ? S< 10:32 0:00 /bin/sh
/sbin/udevsend scsi_devic
root 9191 0.0 0.0 2060 1028 ? S< 10:32 0:00 /bin/sh
/sbin/hotplug scsi_generi
root 9200 0.0 0.0 2060 996 ? S< 10:32 0:00 /bin/sh
/sbin/udevsend scsi_gener
root 9203 0.0 0.0 2060 996 ? S< 10:32 0:00 /bin/sh
/sbin/udevsend block
root 9225 0.0 0.0 2056 992 ? S< 10:32 0:00 /bin/sh
/sbin/udevsend scsi
root 9227 0.0 0.0 2056 992 ? S< 10:32 0:00 /bin/sh
/sbin/udevsend usb
...(ad nauseum it gets pretty large)
Dmesg output with this particular example uninserts/inserts a USB 2.0
Hard Disk
usb 1-2: USB disconnect, address 2
usb 1-2: new high speed USB device using address 3
scsi2 : SCSI emulation for USB Mass Storage devices
Vendor: SAMSUNG Model: SV0602H Rev: RH10
Type: Direct-Access ANSI SCSI revision: 02
SCSI device sdb: 117304992 512-byte hdwr sectors (60060 MB)
sdb: assuming drive cache: write through
sdb: sdb1
Attached scsi disk sdb at scsi2, channel 0, id 0, lun 0
Attached scsi generic sg0 at scsi2, channel 0, id 0, lun 0, type 0
USB Mass Storage device found at 3
Woopsy. Looks like I forgot to issue a umount before I did that...oh
well....e2fsck -f /dev/sdb1 seems to be in order...so while it is doing
that....
As you can see, after any USB device removal or adding a hotplug event
triggers a udevsend race condition.
For those of you curious, udevsend is a simple script (/sbin/udevsend):
#!/bin/sh
if [ -f /etc/sysconfig/udev ]; then
. /etc/sysconfig/udev
fi
sleep 5
[ "$USE_UDEV" != "yes" ] && exit 0
exec /sbin/udevsend "$@"
(I added the sleep 5 line so my system can boot and I can issue a
killall udevsend)
which is called from what I can tell by the kernel when it issues a
/sbin/hotplug command. Why it CONTINUES to issue it after the device is
loaded, and why it doesn't stop is my question.
It would seem that the thing is recursive...(i.e. It calls itself upon
exit) so my guess is $USE_UDEV never becomes NO. So at the moment I am
looking for something that sets US_DEV to NO in the call train.
So if anyone can answer what sets USE_DEV to NO in the HotPlug call
train when a USB device is inserted I would be most happy.
Thanks for your time...
-gc
More information about the fedora-test-list
mailing list