Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Jan 2012 03:26:59 +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-9@freebsd.org
Subject:   svn commit: r229258 - stable/9/sys/fs/nfsclient
Message-ID:  <201201020326.q023Qxjr045648@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Mon Jan  2 03:26:59 2012
New Revision: 229258
URL: http://svn.freebsd.org/changeset/base/229258

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/9/sys/fs/nfsclient/nfs_clvnops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- stable/9/sys/fs/nfsclient/nfs_clvnops.c	Mon Jan  2 00:46:13 2012	(r229257)
+++ stable/9/sys/fs/nfsclient/nfs_clvnops.c	Mon Jan  2 03:26:59 2012	(r229258)
@@ -2941,6 +2941,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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201020326.q023Qxjr045648>