]> git.baikalelectronics.ru Git - kernel.git/commit
uevent: send events in correct order according to seqnum (v3)
authorAndrew Vagin <avagin@openvz.org>
Wed, 7 Mar 2012 10:49:56 +0000 (14:49 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Mar 2012 20:56:40 +0000 (12:56 -0800)
commit97906f346d343f88c091fe1a5e384e3f2b18337e
treecf83f1b5fdd5b7fab96c256f40db877112b277fe
parent14f6fba6c2e23fcc884315001cc597dfb3b02a3c
uevent: send events in correct order according to seqnum (v3)

The queue handling in the udev daemon assumes that the events are
ordered.

Before this patch uevent_seqnum is incremented under sequence_lock,
than an event is send uner uevent_sock_mutex. I want to say that code
contained a window between incrementing seqnum and sending an event.

This patch locks uevent_sock_mutex before incrementing uevent_seqnum.

v2: delete sequence_lock, uevent_seqnum is protected by uevent_sock_mutex
v3: unlock the mutex before the goto exit

Thanks for Kay for the comments.

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Tested-By: Kay Sievers <kay.sievers@vrfy.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lib/kobject_uevent.c