From owner-cvs-all@FreeBSD.ORG Sun May 25 18:14:50 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 EC81A1065676; Sun, 25 May 2008 18:14:50 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 830FA8FC12; Sun, 25 May 2008 18:14:50 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id D75C52BEB3; Mon, 26 May 2008 05:42:36 +1200 (NZST) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KeH67IPB4n-p; Mon, 26 May 2008 05:42:31 +1200 (NZST) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Mon, 26 May 2008 05:42:31 +1200 (NZST) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 2C51411473; Mon, 26 May 2008 05:42:31 +1200 (NZST) Date: Sun, 25 May 2008 10:42:31 -0700 From: Andrew Thompson To: Roman Divacky Message-ID: <20080525174230.GA91789@citylink.fud.org.nz> References: <200805241451.m4OEpU1r053111@repoman.freebsd.org> <20080525172926.GA12033@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080525172926.GA12033@freebsd.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: cvs-src@FreeBSD.org, Ulf Lilleengen , 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 18:14:51 -0000 On Sun, May 25, 2008 at 07:29:26PM +0200, Roman Divacky wrote: > 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? No, because the break exits the loop.