Date: Fri, 23 Jul 2010 15:26:32 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r210419 - stable/7/sys/nfsclient Message-ID: <201007231526.o6NFQWJx031089@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Fri Jul 23 15:26:32 2010 New Revision: 210419 URL: http://svn.freebsd.org/changeset/base/210419 Log: MFC 209946: - Add missing locking around flushing of an NFS node's attribute cache in the NMODIFIED case of nfs_open(). - Cosmetic tweak to simplify an expression in nfs_lookup(). Modified: stable/7/sys/nfsclient/nfs_vnops.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/nfsclient/nfs_vnops.c ============================================================================== --- stable/7/sys/nfsclient/nfs_vnops.c Fri Jul 23 15:26:19 2010 (r210418) +++ stable/7/sys/nfsclient/nfs_vnops.c Fri Jul 23 15:26:32 2010 (r210419) @@ -476,9 +476,11 @@ nfs_open(struct vop_open_args *ap) error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1); if (error == EINTR || error == EIO) return (error); + mtx_lock(&np->n_mtx); np->n_attrstamp = 0; if (vp->v_type == VDIR) np->n_direofoffset = 0; + mtx_unlock(&np->n_mtx); error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td); if (error) return (error); @@ -913,8 +915,8 @@ nfs_lookup(struct vop_lookup_args *ap) */ newvp = *vpp; newnp = VTONFS(newvp); - if ((cnp->cn_flags & (ISLASTCN | ISOPEN)) == - (ISLASTCN | ISOPEN) && !(newnp->n_flag & NMODIFIED)) { + if ((flags & (ISLASTCN | ISOPEN)) == (ISLASTCN | ISOPEN) && + !(newnp->n_flag & NMODIFIED)) { mtx_lock(&newnp->n_mtx); newnp->n_attrstamp = 0; mtx_unlock(&newnp->n_mtx);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007231526.o6NFQWJx031089>