Date: Mon, 27 Sep 2010 02:44:30 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r213192 - stable/8/sys/fs/nfsserver Message-ID: <201009270244.o8R2iUvI010246@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Mon Sep 27 02:44:30 2010 New Revision: 213192 URL: http://svn.freebsd.org/changeset/base/213192 Log: MFC: r212833 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. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Mon Sep 27 02:30:56 2010 (r213191) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Mon Sep 27 02:44:30 2010 (r213192) @@ -2825,7 +2825,7 @@ nfsvno_advlock(struct vnode *vp, int fty 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 fty 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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009270244.o8R2iUvI010246>