Subject: Re: [RFC] bonding: fix workqueue re-arming races

From: Jarek Poplawski <[email-masked]>
Date: Wed, 1 Sep 2010 22:06:07 +0200

On Wed, Sep 01, 2010 at 12:46:30PM -0700, Jay Vosburgh wrote:
> Jarek Poplawski <[email-masked]> wrote:
> 
> >On Wed, Sep 01, 2010 at 09:11:06PM +0200, Jiri Bohac wrote:
> >> But these don't do rtnl_lock() inside the work item, do they?
> >
> >Exactly. Just like work items cancelled from bond_work_cancel_all()
> >after your patch.
> 
> 	I see what Jarek is getting at here: the mii_commit, etc, work
> items new to the patch aren't cancelled by bond_close, so bond_close (in
> cancel_delayed_work_sync) shouldn't care if they're executing or not.
> 
> 	This still would leave the new work items (the "commit" ones
> added in the patch) always free to run at some arbitrary time after
> close, which makes me uneasy.  I don't think the extra "wq_rtnl" makes
> any difference, though.

Sure, but IIRC it wasn't encouraged. After all, many net drivers do it
similarly and don't even need their separate workqueue.

Jarek P.