Return EOPNOTSUPP rather than EPERM for the SF_SNAPSHOT flag because
tmpfs doesn't support snapshots. Suggested by: bde
This commit is contained in:
parent
808dd116cb
commit
fd1062ce4c
@ -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 |
|
if ((flags & ~(UF_NODUMP | UF_IMMUTABLE | UF_APPEND | UF_OPAQUE |
|
||||||
UF_NOUNLINK | SF_ARCHIVED | SF_IMMUTABLE | SF_APPEND |
|
UF_NOUNLINK | SF_ARCHIVED | SF_IMMUTABLE | SF_APPEND |
|
||||||
SF_NOUNLINK | SF_SNAPSHOT)) != 0)
|
SF_NOUNLINK)) != 0)
|
||||||
return (EOPNOTSUPP);
|
return (EOPNOTSUPP);
|
||||||
|
|
||||||
/* Disallow this operation if the file system is mounted read-only. */
|
/* 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)
|
if (error)
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
/* The snapshot flag cannot be toggled. */
|
|
||||||
if ((flags ^ node->tn_flags) & SF_SNAPSHOT)
|
|
||||||
return (EPERM);
|
|
||||||
} else {
|
} else {
|
||||||
if (node->tn_flags &
|
if (node->tn_flags &
|
||||||
(SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND) ||
|
(SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND) ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user