From owner-p4-projects@FreeBSD.ORG Sat Jun 30 00:54:19 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 99BE916A46F; Sat, 30 Jun 2007 00:54:19 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5F75D16A46B for ; Sat, 30 Jun 2007 00:54:19 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id D764D13C457 for ; Sat, 30 Jun 2007 00:54:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l5U0sCfM070369; Fri, 29 Jun 2007 20:54:16 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Roman Divacky Date: Fri, 29 Jun 2007 20:52:06 -0400 User-Agent: KMail/1.9.6 References: <200706281214.l5SCEhFq046327@repoman.freebsd.org> In-Reply-To: <200706281214.l5SCEhFq046327@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200706292052.06861.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Fri, 29 Jun 2007 20:54:16 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/3559/Fri Jun 29 19:24:17 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Perforce Change Reviews Subject: Re: PERFORCE change 122480 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2007 00:54:20 -0000 On Thursday 28 June 2007 08:14:43 am Roman Divacky wrote: > http://perforce.freebsd.org/chv.cgi?CH=122480 > > Change 122480 by rdivacky@rdivacky_witten on 2007/06/28 12:14:14 > > vrele AFTER checking the vp for being on non-MPSAFE FS + some indentation > problems that caused bad scoping > > Noticed by: rwatson (again ;) ) Umm, no. You need Giant for the vrele(). The proper fix is to use the VFS_*_GIANT() macros and use int variables to know if you need to unlock Giant or not. > Affected files ... > > .. //depot/projects/soc2007/rdivacky/linux_at/sys/kern/vfs_syscalls.c#41 edit > > Differences ... > > ==== //depot/projects/soc2007/rdivacky/linux_at/sys/kern/vfs_syscalls.c#41 (text+ko) ==== > > @@ -1164,9 +1164,9 @@ > fdclose(fdp, fp, indx, td); > fdrop(fp, td); > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > return (error); > } > @@ -1272,9 +1272,9 @@ > return (error); > restart: > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > error = kern_get_at(td, fd, &dvp); > if (error && !kern_absolute_path(path, pathseg)) > @@ -1354,9 +1354,9 @@ > } > } > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > NDFREE(&nd, NDF_ONLY_PNBUF); > vput(nd.ni_dvp); > @@ -1419,9 +1419,9 @@ > AUDIT_ARG(mode, mode); > restart: > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > error = kern_get_at(td, fd, &dvp); > if (error && !kern_absolute_path(path, pathseg)) > @@ -1477,9 +1477,9 @@ > out: > #endif > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > vput(nd.ni_dvp); > vn_finished_write(mp); > @@ -1602,10 +1602,10 @@ > error = kern_get_at(td, fd2, &ldvp); > if (error && !kern_absolute_path(path2, segflg)) { > if (pdvp) { > - vrele(pdvp); > if (VFS_NEEDSGIANT(pdvp->v_mount)) > mtx_unlock(&Giant); > - } > + vrele(pdvp); > + } > return (error); > } > > @@ -1662,14 +1662,14 @@ > > out: > if (pdvp) { > - vrele(pdvp); > if (VFS_NEEDSGIANT(pdvp->v_mount)) > mtx_unlock(&Giant); > + vrele(pdvp); > } > if (ldvp) { > - vrele(ldvp); > if (VFS_NEEDSGIANT(ldvp->v_mount)) > mtx_unlock(&Giant); > + vrele(ldvp); > } > return (error); > } > @@ -1737,9 +1737,9 @@ > AUDIT_ARG(text, syspath); > restart: > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > error = kern_get_at(td, fd, &dvp); > if (error && !kern_absolute_path(path2, segflg)) > @@ -1793,9 +1793,9 @@ > VFS_UNLOCK_GIANT(vfslocked); > out: > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > if (segflg != UIO_SYSSPACE) > uma_zfree(namei_zone, syspath); > @@ -1911,9 +1911,9 @@ > > restart: > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > error = kern_get_at(td, fd, &dvp); > if (error && !kern_absolute_path(path, pathseg)) > @@ -1972,9 +1972,9 @@ > NDFREE(&nd, NDF_ONLY_PNBUF); > vput(nd.ni_dvp); > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > if (vp == nd.ni_dvp) > vrele(vp); > @@ -2228,9 +2228,9 @@ > td->td_ucred = cred; > crfree(tmpcred); > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > return (error); > } > @@ -2447,9 +2447,9 @@ > *sbp = sb; > out: > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > return (error); > } > @@ -2514,9 +2514,9 @@ > *sbp = sb; > out: > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > return (error); > } > @@ -2743,9 +2743,9 @@ > td->td_retval[0] = count - auio.uio_resid; > out: > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > return (error); > } > @@ -2993,9 +2993,9 @@ > VFS_UNLOCK_GIANT(vfslocked); > out: > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > return (error); > } > @@ -3045,9 +3045,9 @@ > vrele(nd.ni_vp); > VFS_UNLOCK_GIANT(vfslocked); > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > > return (error); > @@ -3192,9 +3192,9 @@ > VFS_UNLOCK_GIANT(vfslocked); > out: > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > return (error); > } > @@ -3253,9 +3253,9 @@ > VFS_UNLOCK_GIANT(vfslocked); > out: > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > return (error); > } > @@ -3443,9 +3443,9 @@ > VFS_UNLOCK_GIANT(vfslocked); > out: > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > return (error); > } > @@ -3835,10 +3835,10 @@ > error = kern_get_at(td, newfd, &todvp); > if (error && !kern_absolute_path(new, pathseg)) { > if (frdvp) { > - vrele(frdvp); > if (VFS_NEEDSGIANT(frdvp->v_mount)) > mtx_unlock(&Giant); > - } > + vrele(frdvp); > + } > return (error); > } > > @@ -3947,14 +3947,14 @@ > return (0); > out2: > if (frdvp) { > - vrele(frdvp); > if (VFS_NEEDSGIANT(frdvp->v_mount)) > mtx_unlock(&Giant); > + vrele(frdvp); > } > if (todvp) { > - vrele(todvp); > if (VFS_NEEDSGIANT(todvp->v_mount)) > mtx_unlock(&Giant); > + vrele(todvp); > } > return (error); > } > @@ -4013,9 +4013,9 @@ > AUDIT_ARG(mode, mode); > restart: > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > error = kern_get_at(td, fd, &dvp); > if (error && !kern_absolute_path(path, segflg)) > @@ -4076,9 +4076,9 @@ > out: > #endif > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > NDFREE(&nd, NDF_ONLY_PNBUF); > vput(nd.ni_dvp); > @@ -4125,9 +4125,9 @@ > > restart: > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > error = kern_get_at(td, fd, &dvp); > if (error && !kern_absolute_path(path, pathseg)) > @@ -4183,9 +4183,9 @@ > NDFREE(&nd, NDF_ONLY_PNBUF); > vput(vp); > if (dvp) { > - vrele(dvp); > if (VFS_NEEDSGIANT(dvp->v_mount)) > mtx_unlock(&Giant); > + vrele(dvp); > } > if (nd.ni_dvp == vp) > vrele(nd.ni_dvp); > -- John Baldwin