Date: Sat, 16 Apr 2011 22:15:59 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r220731 - head/sys/fs/nfsclient Message-ID: <201104162215.p3GMFxs0017800@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Sat Apr 16 22:15:59 2011 New Revision: 220731 URL: http://svn.freebsd.org/changeset/base/220731 Log: Add mutex locking on the nfs node in ncl_inactive() for the experimental NFS client. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clnode.c Modified: head/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clnode.c Sat Apr 16 16:20:51 2011 (r220730) +++ head/sys/fs/nfsclient/nfs_clnode.c Sat Apr 16 22:15:59 2011 (r220731) @@ -202,12 +202,14 @@ ncl_inactive(struct vop_inactive_args *a (void) nfsrpc_close(vp, 1, ap->a_td); } + mtx_lock(&np->n_mtx); if (vp->v_type != VDIR) { sp = np->n_sillyrename; np->n_sillyrename = NULL; } else sp = NULL; if (sp) { + mtx_unlock(&np->n_mtx); (void) ncl_vinvalbuf(vp, 0, ap->a_td, 1); /* * Remove the silly file that was rename'd earlier @@ -216,8 +218,10 @@ ncl_inactive(struct vop_inactive_args *a crfree(sp->s_cred); vrele(sp->s_dvp); FREE((caddr_t)sp, M_NEWNFSREQ); + mtx_lock(&np->n_mtx); } np->n_flag &= NMODIFIED; + mtx_unlock(&np->n_mtx); return (0); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104162215.p3GMFxs0017800>