From patchwork Tue Apr 18 19:02:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Myungho Jung X-Patchwork-Id: 9686081 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 36ACE602C2 for ; Tue, 18 Apr 2017 19:02:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E00F205F8 for ; Tue, 18 Apr 2017 19:02:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1090025223; Tue, 18 Apr 2017 19:02:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3263205F8 for ; Tue, 18 Apr 2017 19:02:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752610AbdDRTCJ (ORCPT ); Tue, 18 Apr 2017 15:02:09 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:33981 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750710AbdDRTCI (ORCPT ); Tue, 18 Apr 2017 15:02:08 -0400 Received: by mail-pf0-f193.google.com with SMTP id g23so264261pfj.1 for ; Tue, 18 Apr 2017 12:02:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=bJICE7yx9dyrS+CSYArrbuvO6ChutehwvtSNgIMPhWg=; b=FvjxWKamt5ERyruXyWB5VuioA61jKswRChSbSAbgr9wtlLyOeO/BfTh3YB/MzB38Bl TlNjgAb1cAJLCpXwwj5C7g/wVZ5ebwDr/m5uQlMHZRqwKsBqQJ2/ncMMrTQ9mFXszZY4 FYaRJQI+A49j6JJq+ZqNL8Xkju/K15IOQUgh1YjXed2ZNJpI6XTE3evxitVgStIOdJB/ qoxcM8/FIHv0xEo6SUAu7ETYT6xTlU6fMQzC3SjyLLdtj0ch4GoIvBSOdfi32h7T/fGQ iLF/Q/yqeRrVCyn7cPfAcrxY8j5oUZ98Iu5KZDHcL0X+ph0+t1XAp7vzDVZsAHS0JthJ o4cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=bJICE7yx9dyrS+CSYArrbuvO6ChutehwvtSNgIMPhWg=; b=HOt46bGAULTxH9dRD2GkK5MxfKfAqIBQSmrqlBfU6TaM/NCt64WOYEx94mvuYceISw dHy+8YSaFdBPFU7pD1PTLjtHBw/2wC2xE8+kMKz92DcNvpjhxlllf1fNdpzveg123VQQ 0eWUJPlNNRi0OK85vR3DIpFzveqYHdPE7p7gS39WHXqTtGLULP2jgmFSpkMxSl+xjqh8 OLA2NwfomCtsSFo6y31UZBo2psAa+L8c+SaDqoVRVgRlA8C1TK7V/wL3sRw8xEKmgyNR 16h3p53OO4+vWBbYC+O3f70fLVK10bOZVmT8S/MvPOZVKkxLdY0LJVNQHmxdiqMu3wNC pnnw== X-Gm-Message-State: AN3rC/538x6lOS6YOpo/KZHsnru9Shtn76Vy7jsNqVSdgH2fsy2CNpwT rsYeGWS7BFsUZZ7j X-Received: by 10.98.62.141 with SMTP id y13mr19622074pfj.93.1492542127968; Tue, 18 Apr 2017 12:02:07 -0700 (PDT) Received: from localhost (pat_11.qualcomm.com. [192.35.156.11]) by smtp.gmail.com with ESMTPSA id e67sm28554pfe.64.2017.04.18.12.02.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Apr 2017 12:02:07 -0700 (PDT) From: Myungho Jung To: viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org Subject: [PATCH] fs: fix to properly return error code for utimensat Date: Tue, 18 Apr 2017 12:02:06 -0700 Message-Id: <1492542126-14203-1-git-send-email-mhjungk@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);