From: Myungho Jung <mhjungk@gmail.com>
To: viro@zeniv.linux.org.uk
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] fs: fix utimensat to return correct error code
Date: Tue, 16 May 2017 17:28:55 -0700 [thread overview]
Message-ID: <1494980935-6926-1-git-send-email-mhjungk@gmail.com> (raw)
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
reply other threads:[~2017-05-17 0:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1494980935-6926-1-git-send-email-mhjungk@gmail.com \
--to=mhjungk@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).