From owner-cvs-all@FreeBSD.ORG Sun May 25 17:30:10 2008 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B254106566C; Sun, 25 May 2008 17:30:10 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id E17908FC28; Sun, 25 May 2008 17:30:09 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 220266801FD; Sun, 25 May 2008 19:29:28 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QYpWB8xntWiF; Sun, 25 May 2008 19:29:26 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id D05706801FC; Sun, 25 May 2008 19:29:26 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.2/8.14.2/Submit) id m4PHTQAW012133; Sun, 25 May 2008 19:29:26 +0200 (CEST) (envelope-from rdivacky) Date: Sun, 25 May 2008 19:29:26 +0200 From: Roman Divacky To: Ulf Lilleengen Message-ID: <20080525172926.GA12033@freebsd.org> References: <200805241451.m4OEpU1r053111@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200805241451.m4OEpU1r053111@repoman.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/fs/fdescfs fdesc.h fdesc_vfsops.c fdesc_vnops.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2008 17:30:10 -0000 On Sat, May 24, 2008 at 02:51:30PM +0000, Ulf Lilleengen wrote: > lulf 2008-05-24 14:51:30 UTC > > FreeBSD src repository > > Modified files: > sys/fs/fdescfs fdesc.h fdesc_vfsops.c fdesc_vnops.c > Log: > - Add locking to all filesystem operations in fdescfs and flag it as MPSAFE. > - Use proper synhronization primitives to protect the internal fdesc node cache > used in fdescfs. > - Properly initialize and uninitalize hash. > - Remove unused functions. > > Since fdescfs might recurse on itself, adding proper locking to it needed some > tricky workarounds in some parts to make it work. For instance, a descriptor in > fdescfs could refer to an open descriptor to itself, thus forcing the thread to > recurse on vnode locks. Because of this, other race conditions also had to be > fixed. > > Tested by: pho > Reviewed by: kib (mentor) > Approved by: kib (mentor) + LIST_FOREACH(fd2, fc, fd_hash) { + if (fd == fd2) { + LIST_REMOVE(fd, fd_hash); + break; + } + } shouldn't you use LIST_FOREACH_SAFE here?