diff options
author | kib <kib@FreeBSD.org> | 2016-06-26 13:16:02 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2016-06-26 13:16:02 +0000 |
commit | 2c78067327fa61d7d06cd36b60cf163d2d6610dd (patch) | |
tree | 48c4e47d51e6ee204165a085c31763ff4ad68073 /sys/fs | |
parent | 061f244c2d09522a30b3b83f4ce8d01f2628a422 (diff) | |
download | FreeBSD-src-2c78067327fa61d7d06cd36b60cf163d2d6610dd.zip FreeBSD-src-2c78067327fa61d7d06cd36b60cf163d2d6610dd.tar.gz |
MFC r302019:
Do not access NFS data for reclaimed vnode.
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/nfsclient/nfs_clvnops.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index ac0d179..faff121 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -3098,10 +3098,14 @@ nfs_advlock(struct vop_advlock_args *ap) } } if (error == 0 && ap->a_op == F_SETLK) { - /* Mark that a file lock has been acquired. */ - mtx_lock(&np->n_mtx); - np->n_flag |= NHASBEENLOCKED; - mtx_unlock(&np->n_mtx); + error = NFSVOPLOCK(vp, LK_SHARED); + if (error == 0) { + /* Mark that a file lock has been acquired. */ + mtx_lock(&np->n_mtx); + np->n_flag |= NHASBEENLOCKED; + mtx_unlock(&np->n_mtx); + NFSVOPUNLOCK(vp, 0); + } } } return (error); |