Re: [PATCH] udev: fix problem due to unsorted events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 6, 2012 at 13:13, Andrew Wagin <avagin@xxxxxxxxx> wrote:
> 2012/3/6 Kay Sievers <kay.sievers@xxxxxxxx>:
>> On Tue, Mar 6, 2012 at 09:48, Andrey Vagin <avagin@xxxxxxxxx> wrote:
>>> From: Andrey Vagin <avagin@xxxxxxxxxx>
>>>
>>> A kernel gives events, but this events can be unsorted.
>>> For example, here is log from system:
>>> udevd[77]: seq 924 queued, 'add' 'bdi'
>>> udevd[77]: seq 926 queued, 'add' 'block'
>>> udevd[77]: seq 927 queued, 'add' 'block'
>>> udevd[77]: seq 928 queued, 'add' 'block
>>> udevd[77]: seq 925 queued, 'add' 'drivers'
>>
>> The kernel cannot send un-ordered events. Please try to reproduce that
>> with 'udevadm monitor'.
>
> I can't reproduce this bug, because I have not this host already.
> I've attached the console.log. I have not other logs.
> I showed you messages from event_queue_insert(). Actually it's what you ask.
> I suppose that a kernel should not send un-ordered events, but it does.
>
> Let's look at kobject_uevent_env() in kernel source:
>
>        spin_lock(&sequence_lock);
>        seq = ++uevent_seqnum;
>        spin_unlock(&sequence_lock);
>
> .... <-- here someone can send its event
>
>        /* send netlink message */
>        mutex_lock(&uevent_sock_mutex);
> .....
>
> I want to say that code contains a window between incrementing seqnum
> and sending an event.

Yeah, that looks suspicious. We need to find out what and how to fix
that. The queue handling in the daemon assumes that the events are
ordered, so there might not only a problem with 'settle'.

Kay
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux