lkml.org 
[lkml]   [2011]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RESEND 2/3 v2.6.39-rc7] block: make disk_block_events() properly wait for work cancellation
On Wed, May 18, 2011 at 12:04:51PM +0200, Tejun Heo wrote:
> Yeap, the problem was unblock/check being allowed to be called without
> sleeping context, which isn't used anymore and was broken due to
> cancellation race. We can just enclose the whole thing inside per-ev
> mutex and everything should be simple and fine. I'll post patches
> soon.

Oops, spoke too soon. Converting to mutex creates a circular
dependency. disk_block_events() acquires ev->lock and waits for
ev->dwork to finish, but ev->dwork also needs to acquire ev->lock to
update event states. So, no matter how we twist this, we need two
locks or a lock and a completion. The mutex approach seems simple
enough, so I suggest leaving it like that.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2011-05-18 13:09    [W:1.659 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site