svn commit: r229259 - in stable/8/sys: conf fs/nfsclient

Rick Macklem rmacklem at FreeBSD.org
Mon Jan 2 03:52:35 UTC 2012


Author: rmacklem
Date: Mon Jan  2 03:52:34 2012
New Revision: 229259
URL: http://svn.freebsd.org/changeset/base/229259

Log:
  MFC: r227494
  Since NFSv4 byte range locking only works for regular files,
  add a sanity check for the vnode type to the NFSv4 client.

Modified:
  stable/8/sys/fs/nfsclient/nfs_clvnops.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/conf/ldscript.mips.octeon1.32   (props changed)
  stable/8/sys/conf/ldscript.mips.octeon1.64   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- stable/8/sys/fs/nfsclient/nfs_clvnops.c	Mon Jan  2 03:26:59 2012	(r229258)
+++ stable/8/sys/fs/nfsclient/nfs_clvnops.c	Mon Jan  2 03:52:34 2012	(r229259)
@@ -2877,6 +2877,8 @@ nfs_advlock(struct vop_advlock_args *ap)
 	u_quad_t size;
 	
 	if (NFS_ISV4(vp) && (ap->a_flags & (F_POSIX | F_FLOCK)) != 0) {
+		if (vp->v_type != VREG)
+			return (EINVAL);
 		if ((ap->a_flags & F_POSIX) != 0)
 			cred = p->p_ucred;
 		else


More information about the svn-src-stable-8 mailing list