From owner-freebsd-current@FreeBSD.ORG Fri Jan 27 17:44:54 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAD32106564A for ; Fri, 27 Jan 2012 17:44:54 +0000 (UTC) (envelope-from aboyer@averesystems.com) Received: from zimbra.averesystems.com (75-149-8-245-Pennsylvania.hfc.comcastbusiness.net [75.149.8.245]) by mx1.freebsd.org (Postfix) with ESMTP id 86D308FC0C for ; Fri, 27 Jan 2012 17:44:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra.averesystems.com (Postfix) with ESMTP id 26ACF446004; Fri, 27 Jan 2012 12:27:24 -0500 (EST) X-Virus-Scanned: amavisd-new at averesystems.com Received: from zimbra.averesystems.com ([127.0.0.1]) by localhost (zimbra.averesystems.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id s0WDV2wUShsX; Fri, 27 Jan 2012 12:27:21 -0500 (EST) Received: from riven.arriad.com (fw.arriad.com [10.0.0.16]) by zimbra.averesystems.com (Postfix) with ESMTPSA id DB22C446002; Fri, 27 Jan 2012 12:27:21 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Andrew Boyer In-Reply-To: <201201271715.q0RHFqZc086859@ambrisko.com> Date: Fri, 27 Jan 2012 12:25:24 -0500 Content-Transfer-Encoding: 7bit Message-Id: <5EDB646F-513F-411A-ABBC-6DA555D2EAC6@averesystems.com> References: <201201271715.q0RHFqZc086859@ambrisko.com> To: Doug Ambrisko X-Mailer: Apple Mail (2.1084) Cc: Kostik Belousov , freebsd-current@freebsd.org Subject: Re: knlist_empty locking fix X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 17:44:54 -0000 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