From owner-cvs-src@FreeBSD.ORG Fri Oct 5 07:54:09 2007 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A76C116A418; Fri, 5 Oct 2007 07:54:09 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (arm132.internetdsl.tpnet.pl [83.17.198.132]) by mx1.freebsd.org (Postfix) with ESMTP id F100913C459; Fri, 5 Oct 2007 07:54:08 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 71D8045F57; Fri, 5 Oct 2007 09:32:18 +0200 (CEST) Received: from localhost (154.81.datacomsa.pl [195.34.81.154]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 1F3DB45F42; Fri, 5 Oct 2007 09:32:14 +0200 (CEST) Date: Fri, 5 Oct 2007 09:32:02 +0200 From: Pawel Jakub Dawidek To: Jeff Roberson Message-ID: <20071005073202.GA94586@garage.freebsd.pl> References: <200710032106.l93L65bv095725@repoman.freebsd.org> <20071003164642.B615@10.0.0.1> <200710041219.13202.jhb@freebsd.org> <20071004182759.U912@10.0.0.1> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Q68bSM7Ycu6FN28Q" Content-Disposition: inline In-Reply-To: <20071004182759.U912@10.0.0.1> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 7.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=BAYES_00 autolearn=ham version=3.0.4 Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org, John Baldwin Subject: Re: cvs commit: src/sys/fs/devfs devfs_vnops.c src/sys/fs/fifofs fifo_vnops.c src/sys/kern uipc_usrreq.c vfs_vnops.c src/sys/vm vnode_pager.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Oct 2007 07:54:09 -0000 --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 04, 2007 at 06:29:25PM -0700, Jeff Roberson wrote: > On Thu, 4 Oct 2007, John Baldwin wrote: >=20 > >On Wednesday 03 October 2007 07:48:00 pm Jeff Roberson wrote: > >>On Wed, 3 Oct 2007, John Baldwin wrote: > >> > >>>jhb 2007-10-03 21:06:05 UTC > >>> > >>> FreeBSD src repository > >>> > >>> Modified files: (Branch: RELENG_6) > >>> sys/fs/devfs devfs_vnops.c > >>> sys/fs/fifofs fifo_vnops.c > >>> sys/kern uipc_usrreq.c vfs_vnops.c > >>> sys/vm vnode_pager.c > >>> Log: > >>> MFC: Always use an exclusive lock on the leaf vnode during an open()= =20 > >>> when > >>> shared lookups are enabled. This closes a few races including a race > >where > >>> concurrent opens of a fifo could result in different v_fifoinfo > >structures > >>> in different threads. > >> > >>Long term we should really look for a better solution to this problem. > >>There are a number of was to improve snapshots in ffs by fixing shared > >>locking. > > > >I don't disagree. The fifo case can be fixed easily enough in the fifo= =20 > >code > >by using fifo_mtx to protect v_fifoinfo perhaps (or doing an upgrade on = the > >vnode lock?), but for the MFC I didn't want to have to fix each of the= =20 > >races > >with open(2). Probably better to fix it more properly in HEAD first. >=20 > Definitely someting for head. Were there any others that you ran into=20 > besides v_fifoinfo? We should audit this more closely anyhow. I have=20 > been reluctant to push too much shared locking into VFS because it's not= =20 > been so carefully studied. You probably talking about my patch. I agree, but there are many inconsistencies. People tend to use exclusive locking everywhere. We could start from converting places where sometimes we use shared locking and sometimes exclusive, eg. VOP_READ(), VOP_GETATTR(), etc. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --Q68bSM7Ycu6FN28Q Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFHBehyForvXbEpPzQRAi/UAKDZ8XfXJoG2A5iDl7tGaNCsnqKkWACgwez7 E6TTVa+ymrZg74FHnX7DBCk= =dh7V -----END PGP SIGNATURE----- --Q68bSM7Ycu6FN28Q--