summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/fs/nfsclient/nfs_clvnops.c12
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);
OpenPOWER on IntegriCloud