svn commit: r234489 - head/sys/kern

Jaakko Heinonen jh at FreeBSD.org
Fri Apr 20 10:08:31 UTC 2012


Author: jh
Date: Fri Apr 20 10:08:30 2012
New Revision: 234489
URL: http://svn.freebsd.org/changeset/base/234489

Log:
  The value of flags matching VNOVAL can't be supported. Return EOPNOTSUPP
  from setfflags() in this case. This fixes the return value of
  chflags(path, -1).
  
  Discussed with:	bde
  MFC after:	2 weeks

Modified:
  head/sys/kern/vfs_syscalls.c

Modified: head/sys/kern/vfs_syscalls.c
==============================================================================
--- head/sys/kern/vfs_syscalls.c	Fri Apr 20 10:06:28 2012	(r234488)
+++ head/sys/kern/vfs_syscalls.c	Fri Apr 20 10:08:30 2012	(r234489)
@@ -2744,6 +2744,10 @@ setfflags(td, vp, flags)
 	struct mount *mp;
 	struct vattr vattr;
 
+	/* We can't support the value matching VNOVAL. */
+	if (flags == VNOVAL)
+		return (EOPNOTSUPP);
+
 	/*
 	 * Prevent non-root users from setting flags on devices.  When
 	 * a device is reused, users can retain ownership of the device


More information about the svn-src-all mailing list