Return-Path: Received: from mail-pf0-f195.google.com ([209.85.192.195]:36792 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162816AbdD2Aen (ORCPT ); Fri, 28 Apr 2017 20:34:43 -0400 Received: by mail-pf0-f195.google.com with SMTP id v14so19522411pfd.3 for ; Fri, 28 Apr 2017 17:34:42 -0700 (PDT) From: Myungho Jung To: viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org Subject: [PATCH] fs: fix utimensat to properly return error code Date: Fri, 28 Apr 2017 17:34:41 -0700 Message-Id: <1493426081-22864-1-git-send-email-mhjungk@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 in LTP. Signed-off-by: Myungho Jung --- 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