From owner-p4-projects@FreeBSD.ORG Sat Jun 30 00:54:17 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 71A9016A46E; Sat, 30 Jun 2007 00:54:17 +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 4FB3116A46C for ; Sat, 30 Jun 2007 00:54:17 +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 C1BCC13C44B for ; Sat, 30 Jun 2007 00:54:16 +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 l5U0sCfL070369; Fri, 29 Jun 2007 20:54:14 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Roman Divacky Date: Fri, 29 Jun 2007 20:51:03 -0400 User-Agent: KMail/1.9.6 References: <200706281150.l5SBoAsk043177@repoman.freebsd.org> In-Reply-To: <200706281150.l5SBoAsk043177@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200706292051.03868.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:14 -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 122478 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:17 -0000 On Thursday 28 June 2007 07:50:10 am Roman Divacky wrote: > http://perforce.freebsd.org/chv.cgi?CH=122478 > > Change 122478 by rdivacky@rdivacky_witten on 2007/06/28 11:49:10 > > Lock Giant in a case of non-MPSAFE fs. Put in some forgotten vrele(dvp)... Please use the existing VFS_LOCK_GIANT() and VFS_UNLOCK_GIANT() macros. > Affected files ... > > .. //depot/projects/soc2007/rdivacky/linux_at/sys/kern/vfs_syscalls.c#39 edit > > Differences ... > > ==== //depot/projects/soc2007/rdivacky/linux_at/sys/kern/vfs_syscalls.c#39 (text+ko) ==== > > @@ -994,6 +994,8 @@ > *dvpp = NULL; > return (ENOTDIR); > } > + if (VFS_NEEDSGIANT((*dvpp)->v_mount)) > + mtx_lock(&Giant); > } > > return (0); > @@ -1161,8 +1163,11 @@ > VFS_UNLOCK_GIANT(vfslocked); > fdclose(fdp, fp, indx, td); > fdrop(fp, td); > - if (dvp) > + if (dvp) { > vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > return (error); > } > > @@ -1266,8 +1271,11 @@ > if (error) > return (error); > restart: > - if (dvp) > + if (dvp) { > vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > error = kern_get_at(td, fd, &dvp); > if (error && !kern_absolute_path(path, pathseg)) > return (error); > @@ -1345,8 +1353,11 @@ > vput(nd.ni_vp); > } > } > - if (dvp) > + if (dvp) { > vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > NDFREE(&nd, NDF_ONLY_PNBUF); > vput(nd.ni_dvp); > vn_finished_write(mp); > @@ -1407,8 +1418,11 @@ > > AUDIT_ARG(mode, mode); > restart: > - if (dvp) > + if (dvp) { > vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > error = kern_get_at(td, fd, &dvp); > if (error && !kern_absolute_path(path, pathseg)) > return (error); > @@ -1462,8 +1476,11 @@ > #ifdef MAC > out: > #endif > - if (dvp) > + if (dvp) { > vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > vput(nd.ni_dvp); > vn_finished_write(mp); > VFS_UNLOCK_GIANT(vfslocked); > @@ -1584,7 +1601,10 @@ > > error = kern_get_at(td, fd2, &ldvp); > if (error && !kern_absolute_path(path2, segflg)) { > - if (pdvp) > + if (pdvp) { > + if (VFS_NEEDSGIANT(pdvp->v_mount)) > + mtx_unlock(&Giant); > + } > vrele(pdvp); > return (error); > } > @@ -1641,10 +1661,16 @@ > VFS_UNLOCK_GIANT(vfslocked); > > out: > - if (pdvp) > + if (pdvp) { > vrele(pdvp); > - if (ldvp) > + if (VFS_NEEDSGIANT(pdvp->v_mount)) > + mtx_unlock(&Giant); > + } > + if (ldvp) { > vrele(ldvp); > + if (VFS_NEEDSGIANT(ldvp->v_mount)) > + mtx_unlock(&Giant); > + } > return (error); > } > > @@ -1710,8 +1736,11 @@ > } > AUDIT_ARG(text, syspath); > restart: > - if (dvp) > + if (dvp) { > vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > error = kern_get_at(td, fd, &dvp); > if (error && !kern_absolute_path(path2, segflg)) > return (error); > @@ -1763,8 +1792,11 @@ > vn_finished_write(mp); > VFS_UNLOCK_GIANT(vfslocked); > out: > - if (dvp) > + if (dvp) { > vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > if (segflg != UIO_SYSSPACE) > uma_zfree(namei_zone, syspath); > return (error); > @@ -1878,8 +1910,11 @@ > int vfslocked; > > restart: > - if (dvp) > + if (dvp) { > vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > error = kern_get_at(td, fd, &dvp); > if (error && !kern_absolute_path(path, pathseg)) > return (error); > @@ -1936,8 +1971,11 @@ > } > NDFREE(&nd, NDF_ONLY_PNBUF); > vput(nd.ni_dvp); > - if (dvp) > + if (dvp) { > vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > if (vp == nd.ni_dvp) > vrele(vp); > else > @@ -2189,8 +2227,11 @@ > out: > td->td_ucred = cred; > crfree(tmpcred); > - if (dvp) > + if (dvp) { > vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > return (error); > } > > @@ -2405,8 +2446,11 @@ > if (error == 0) > *sbp = sb; > out: > - if (dvp) > + if (dvp) { > vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > return (error); > } > > @@ -2469,8 +2513,11 @@ > if (error == 0) > *sbp = sb; > out: > - if (dvp) > + if (dvp) { > vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > return (error); > } > > @@ -2695,8 +2742,11 @@ > VFS_UNLOCK_GIANT(vfslocked); > td->td_retval[0] = count - auio.uio_resid; > out: > - if (dvp) > + if (dvp) { > vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > return (error); > } > > @@ -2942,8 +2992,11 @@ > vrele(nd.ni_vp); > VFS_UNLOCK_GIANT(vfslocked); > out: > - if (dvp) > + if (dvp) { > vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > return (error); > } > > @@ -2991,6 +3044,12 @@ > error = setfmode(td, nd.ni_vp, mode); > vrele(nd.ni_vp); > VFS_UNLOCK_GIANT(vfslocked); > + if (dvp) { > + vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > + > return (error); > } > > @@ -3132,8 +3191,11 @@ > vrele(nd.ni_vp); > VFS_UNLOCK_GIANT(vfslocked); > out: > - if (dvp) > + if (dvp) { > vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > return (error); > } > > @@ -3190,8 +3252,11 @@ > vrele(nd.ni_vp); > VFS_UNLOCK_GIANT(vfslocked); > out: > - if (dvp) > + if (dvp) { > vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > return (error); > } > > @@ -3377,8 +3442,11 @@ > vrele(nd.ni_vp); > VFS_UNLOCK_GIANT(vfslocked); > out: > - if (dvp) > + if (dvp) { > vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > return (error); > } > > @@ -3766,7 +3834,10 @@ > > error = kern_get_at(td, newfd, &todvp); > if (error && !kern_absolute_path(new, pathseg)) { > - if (frdvp) > + if (frdvp) { > + if (VFS_NEEDSGIANT(frdvp->v_mount)) > + mtx_unlock(&Giant); > + } > vrele(frdvp); > return (error); > } > @@ -3875,11 +3946,16 @@ > if (error == -1) > return (0); > out2: > - if (frdvp) > + if (frdvp) { > vrele(frdvp); > - if (todvp) > + if (VFS_NEEDSGIANT(frdvp->v_mount)) > + mtx_unlock(&Giant); > + } > + if (todvp) { > vrele(todvp); > - > + if (VFS_NEEDSGIANT(todvp->v_mount)) > + mtx_unlock(&Giant); > + } > return (error); > } > > @@ -3936,8 +4012,11 @@ > > AUDIT_ARG(mode, mode); > restart: > - if (dvp) > + if (dvp) { > vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > error = kern_get_at(td, fd, &dvp); > if (error && !kern_absolute_path(path, segflg)) > return (error); > @@ -3996,8 +4075,11 @@ > #ifdef MAC > out: > #endif > - if (dvp) > + if (dvp) { > vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > NDFREE(&nd, NDF_ONLY_PNBUF); > vput(nd.ni_dvp); > if (!error) > @@ -4042,6 +4124,11 @@ > int vfslocked; > > restart: > + if (dvp) { > + vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > error = kern_get_at(td, fd, &dvp); > if (error && !kern_absolute_path(path, pathseg)) > return (error); > @@ -4095,6 +4182,11 @@ > out: > NDFREE(&nd, NDF_ONLY_PNBUF); > vput(vp); > + if (dvp) { > + vrele(dvp); > + if (VFS_NEEDSGIANT(dvp->v_mount)) > + mtx_unlock(&Giant); > + } > if (nd.ni_dvp == vp) > vrele(nd.ni_dvp); > else > -- John Baldwin