Messages in this thread | | | Date | Wed, 18 May 2011 13:07:32 +0200 | From | Tejun Heo <> | Subject | Re: [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
| |