Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Apr 2012 15:22:08 +0000 (UTC)
From:      Jaakko Heinonen <jh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r234422 - head/sys/fs/tmpfs
Message-ID:  <201204181522.q3IFM81K037391@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jh
Date: Wed Apr 18 15:22:08 2012
New Revision: 234422
URL: http://svn.freebsd.org/changeset/base/234422

Log:
  Return EOPNOTSUPP rather than EPERM for the SF_SNAPSHOT flag because
  tmpfs doesn't support snapshots.
  
  Suggested by:	bde

Modified:
  head/sys/fs/tmpfs/tmpfs_subr.c

Modified: head/sys/fs/tmpfs/tmpfs_subr.c
==============================================================================
--- head/sys/fs/tmpfs/tmpfs_subr.c	Wed Apr 18 15:19:00 2012	(r234421)
+++ head/sys/fs/tmpfs/tmpfs_subr.c	Wed Apr 18 15:22:08 2012	(r234422)
@@ -1080,7 +1080,7 @@ tmpfs_chflags(struct vnode *vp, int flag
 
 	if ((flags & ~(UF_NODUMP | UF_IMMUTABLE | UF_APPEND | UF_OPAQUE |
 	    UF_NOUNLINK | SF_ARCHIVED | SF_IMMUTABLE | SF_APPEND |
-	    SF_NOUNLINK | SF_SNAPSHOT)) != 0)
+	    SF_NOUNLINK)) != 0)
 		return (EOPNOTSUPP);
 
 	/* Disallow this operation if the file system is mounted read-only. */
@@ -1104,9 +1104,6 @@ tmpfs_chflags(struct vnode *vp, int flag
 			if (error)
 				return (error);
 		}
-		/* The snapshot flag cannot be toggled. */
-		if ((flags ^ node->tn_flags) & SF_SNAPSHOT)
-			return (EPERM);
 	} else {
 		if (node->tn_flags &
 		    (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND) ||



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