diff options
author | jh <jh@FreeBSD.org> | 2012-04-18 15:22:08 +0000 |
---|---|---|
committer | jh <jh@FreeBSD.org> | 2012-04-18 15:22:08 +0000 |
commit | ce0372c7aa74c009871f7712d2756da7e90b48d0 (patch) | |
tree | da12ecca7014a2c615a14ffc83e5f378bacd9960 /sys/fs/tmpfs | |
parent | 60a904bd9ea0ad8bda37c7ee226caf42dd2e011b (diff) | |
download | FreeBSD-src-ce0372c7aa74c009871f7712d2756da7e90b48d0.zip FreeBSD-src-ce0372c7aa74c009871f7712d2756da7e90b48d0.tar.gz |
Return EOPNOTSUPP rather than EPERM for the SF_SNAPSHOT flag because
tmpfs doesn't support snapshots.
Suggested by: bde
Diffstat (limited to 'sys/fs/tmpfs')
-rw-r--r-- | sys/fs/tmpfs/tmpfs_subr.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 1a0de17..9395824 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -1080,7 +1080,7 @@ tmpfs_chflags(struct vnode *vp, int flags, struct ucred *cred, struct thread *p) 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 flags, struct ucred *cred, struct thread *p) 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) || |