Receiving two REMOVE actions for the same USB drive

Mason mpeg.blue at free.fr
Mon Apr 28 16:03:01 UTC 2014


Isaac Dunham wrote:

> Mason wrote:
> 
>> Ralf Friedl wrote:
>> 
>>> If you say that simple filtering of the events would be annoying, you 
>>> don't want to change the kernel to avoid the double notification.
>> 
>> What do you mean by "you don't want to change the kernel" ?
>> 
>> I am /pretty sure/ that the vanilla kernel does not notify twice,
>> and that this bug was introduced by one of the vendor's patches. 
> 
> A normal kernel will generate _tons_ of messages per USB device.

You are correct, of course.

This mdev is configured to filter out most of the kernel notifications,
as we are only interested in block events.

# cat /etc/mdev.conf
$SUBSYSTEM=block 0:0 660 ! */application/forward_events

When a block device is inserted, I receive
- one "add" action for the block device itself
- then one "add" action for each partition on the block device
(e.g. MDEV=sda, MDEV=sda1, MDEV=sda2, etc)

when the device is removed, I should receive the "symmetric" events
- one "remove" action for each partition
- then one remove action for the block device itself

Do you disagree?

> Just tested with a random USB device, vanilla kernel 3.10.33;
> I get 2x ACTION=add, 2x ACTION=remove

What SUBSYSTEM is it for?
What are the values of MDEV each time?

-- 
Regards.


More information about the busybox mailing list