Skip to contentSkip to conversation

fs: fix utimensat to return correct error code

PATCH New Myungho Jung 1 participant 1 message May 17, 2017 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: fix utimensat to return correct error code

According to man utimensat(2), EACCES should be returned if the file is immutable and time values are null or UTIME_NOW. Testcase is utimesat01/LTP.

---
 fs/attr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/attr.c +1 -1
index 1353041..4c06aae 100644
@@ -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);
Signature · 1 line
2.7.4