Re: knlist_empty locking fix

看板FB_current作者時間14年前 (2012/01/28 02:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串7/10 (看更多)
On Jan 27, 2012, at 12:15 PM, Doug Ambrisko wrote: > John Baldwin writes: > | Agreed, I think the missing locking should just be added to the aio code. > > Okay so then just: > > Index: vfs_aio.c > =================================================================== > RCS file: /usr/local/cvsroot/freebsd/src/sys/kern/vfs_aio.c,v > retrieving revision 1.243.2.3.4.1 > diff -u -p -r1.243.2.3.4.1 vfs_aio.c > --- vfs_aio.c 21 Dec 2010 17:09:25 -0000 1.243.2.3.4.1 > +++ vfs_aio.c 27 Jan 2012 17:07:11 -0000 > @@ -2509,9 +2509,12 @@ static void > filt_aiodetach(struct knote *kn) > { > struct aiocblist *aiocbe = kn->kn_ptr.p_aio; > + struct knlist *knl = &aiocbe->klist; > > - if (!knlist_empty(&aiocbe->klist)) > - knlist_remove(&aiocbe->klist, kn, 0); > + knl->kl_lock(knl->kl_lockarg); > + if (!knlist_empty(knl)) > + knlist_remove(knl, kn, 1); > + knl->kl_unlock(knl->kl_lockarg); > } > > /* kqueue filter function */ > > I was trying to be consistant with knlist_remove but this is a much > smaller change that can be merge to older branches. > > Thanks, > > Doug A. Does filt_liodetach() need the same treatment? -Andrew -------------------------------------------------- Andrew Boyer aboyer@averesystems.com _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1F8kPXij (FB_current)
討論串 (同標題文章)
文章代碼(AID): #1F8kPXij (FB_current)