Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1642903 > unrolled thread

[PATCH] fs: fix utimensat to return correct error code

Started byMyungho Jung <mhjungk@gmail.com>
First post2017-05-17 02:30 +0200
Last post2017-05-17 02:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] fs: fix utimensat to return correct error code Myungho Jung <mhjungk@gmail.com> - 2017-05-17 02:30 +0200

#1642903 — [PATCH] fs: fix utimensat to return correct error code

FromMyungho Jung <mhjungk@gmail.com>
Date2017-05-17 02:30 +0200
Subject[PATCH] fs: fix utimensat to return correct error code
Message-ID<tHV0J-4jx-5@gated-at.bofh.it>
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.

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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web