svn commit: r227494 - head/sys/fs/nfsclient
Rick Macklem
rmacklem at FreeBSD.org
Mon Nov 14 00:10:12 UTC 2011
Author: rmacklem
Date: Mon Nov 14 00:10:11 2011
New Revision: 227494
URL: http://svn.freebsd.org/changeset/base/227494
Log:
Since NFSv4 byte range locking only works for regular files,
add a sanity check for the vnode type to the NFSv4 client.
MFC after: 2 weeks
Modified:
head/sys/fs/nfsclient/nfs_clvnops.c
Modified: head/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvnops.c Sun Nov 13 23:09:26 2011 (r227493)
+++ head/sys/fs/nfsclient/nfs_clvnops.c Mon Nov 14 00:10:11 2011 (r227494)
@@ -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
More information about the svn-src-head
mailing list