* [PATCH] fs: fix to properly return error code for utimensat
@ 2017-04-18 19:02 Myungho Jung
0 siblings, 0 replies; only message in thread
From: Myungho Jung @ 2017-04-18 19:02 UTC (permalink / raw)
To: viro; +Cc: linux-fsdevel
According to man utimensat(2), EACCES should be returned if the file is
immutable and time values are null or UTIME_NOW. This is found by
utimesat01 testcase of LTP.
Signed-off-by: Myungho Jung <mhjungk@gmail.com>
---
fs/attr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/attr.c b/fs/attr.c
index 1353041..4c06aae 100644
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -222,7 +222,7 @@ int notify_change(struct dentry * dentry, struct iattr * attr, struct inode **de
*/
if (ia_valid & ATTR_TOUCH) {
if (IS_IMMUTABLE(inode))
- return -EPERM;
+ return -EACCES;
if (!inode_owner_or_capable(inode)) {
error = inode_permission(inode, MAY_WRITE);
--
2.7.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-04-18 19:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-18 19:02 [PATCH] fs: fix to properly return error code for utimensat Myungho Jung
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).