From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg Kroah-Hartman Date: Wed, 07 Mar 2012 05:52:06 +0000 Subject: Re: [PATCH] uevent: send events in correct order according to seqnum Message-Id: <20120307055206.GA8217@kroah.com> List-Id: References: <1331064368-55675-1-git-send-email-avagin@openvz.org> <4F567E1C.80003@gmail.com> In-Reply-To: <4F567E1C.80003@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: "avagin@gmail.com" Cc: Kay Sievers , Andrew Vagin , linux-hotplug@vger.kernel.org, linux-kernel@vger.kernel.org On Wed, Mar 07, 2012 at 01:14:04AM +0400, avagin@gmail.com wrote: > On 03/07/2012 01:03 AM, Kay Sievers wrote: > >On Tue, Mar 6, 2012 at 21:06, Andrew Vagin wrote: > >> > >>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. > > > >I think we can remove the spin_lock(&sequence_lock); entirely now, right? > > I thought about that too. sequence_lock is used when CONFIG_NET > isn't defined. I've looked on this code one more time and we may > leave only uevent_sock_mutex and use it even when CONFIG_NET isn't > defined. > Thanks for the comment. > > Greg, do you have other objections about this patch? Let's see the one based on Kay's comments first please. thanks, greg k-h