summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2010-09-19 01:05:19 +0000
committerrmacklem <rmacklem@FreeBSD.org>2010-09-19 01:05:19 +0000
commit05211dfe9fe155103b65707bafb0840d073373c8 (patch)
treef8ef3088a9e221efabbec164b4eefb428323661a /sys/fs
parent474eeb6f588391a2b1aef1042ce3485d1d9ebda8 (diff)
downloadFreeBSD-src-05211dfe9fe155103b65707bafb0840d073373c8.zip
FreeBSD-src-05211dfe9fe155103b65707bafb0840d073373c8.tar.gz
Fix the experimental NFSv4 server so that it performs local VOP_ADVLOCK()
unlock operations correctly. It was passing in F_SETLK instead of F_UNLCK as the operation for the unlock case. This only affected operation when local locking (vfs.newnfs.enable_locallocks=1) was enabled. MFC after: 1 week
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/nfsserver/nfs_nfsdport.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c
index 5bcac95..5e50d3e 100644
--- a/sys/fs/nfsserver/nfs_nfsdport.c
+++ b/sys/fs/nfsserver/nfs_nfsdport.c
@@ -2825,7 +2825,7 @@ nfsvno_advlock(struct vnode *vp, int ftype, u_int64_t first,
struct flock fl;
u_int64_t tlen;
- if (!nfsrv_dolocallocks)
+ if (nfsrv_dolocallocks == 0)
return (0);
fl.l_whence = SEEK_SET;
fl.l_type = ftype;
@@ -2850,8 +2850,12 @@ nfsvno_advlock(struct vnode *vp, int ftype, u_int64_t first,
fl.l_sysid = (int)nfsv4_sysid;
NFSVOPUNLOCK(vp, 0, td);
- error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_SETLK, &fl,
- (F_POSIX | F_REMOTE));
+ if (ftype == F_UNLCK)
+ error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_UNLCK, &fl,
+ (F_POSIX | F_REMOTE));
+ else
+ error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_SETLK, &fl,
+ (F_POSIX | F_REMOTE));
NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, td);
return (error);
}
OpenPOWER on IntegriCloud