diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2011-04-16 22:15:59 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2011-04-16 22:15:59 +0000 |
commit | 8ae8da4156ef9141be0d9415a04c13dff5ce464f (patch) | |
tree | 2ae3a7dca91749cc5fc92fb833dffa6ad6c4edaf /sys/fs | |
parent | 95da67cdb879f2629d864907d93b430ff3c237fb (diff) | |
download | FreeBSD-src-8ae8da4156ef9141be0d9415a04c13dff5ce464f.zip FreeBSD-src-8ae8da4156ef9141be0d9415a04c13dff5ce464f.tar.gz |
Add mutex locking on the nfs node in ncl_inactive() for the
experimental NFS client.
MFC after: 2 weeks
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/nfsclient/nfs_clnode.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/fs/nfsclient/nfs_clnode.c b/sys/fs/nfsclient/nfs_clnode.c index 01e1919..c6b212a 100644 --- a/sys/fs/nfsclient/nfs_clnode.c +++ b/sys/fs/nfsclient/nfs_clnode.c @@ -202,12 +202,14 @@ ncl_inactive(struct vop_inactive_args *ap) (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 *ap) 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); } |