From patchwork Wed Mar 28 10:12:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: chenditang X-Patchwork-Id: 10312727 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 C221F60353 for ; Wed, 28 Mar 2018 10:10:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A75BD29E7D for ; Wed, 28 Mar 2018 10:10:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C12E29EF6; Wed, 28 Mar 2018 10:10:50 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 86B9E29E89 for ; Wed, 28 Mar 2018 10:10:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752831AbeC1KKs (ORCPT ); Wed, 28 Mar 2018 06:10:48 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:41806 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752737AbeC1KKr (ORCPT ); Wed, 28 Mar 2018 06:10:47 -0400 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="38289919" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 28 Mar 2018 18:10:46 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id B461148AE76D; Wed, 28 Mar 2018 18:10:44 +0800 (CST) Received: from chendt.G08FNSTD121248 (10.167.226.135) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server id 14.3.361.1; Wed, 28 Mar 2018 18:10:43 +0800 From: chendt Subject: [PATCH] NFSv3/acl: forget acl cache after setattr To: CC: Trond Myklebust Message-ID: Date: Wed, 28 Mar 2018 18:12:23 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Language: en-US X-Originating-IP: [10.167.226.135] X-yoursite-MailScanner-ID: B461148AE76D.A702C X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: chendt.fnst@cn.fujitsu.com Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Sync of ACL with std permissions fail,do We need to forget the ACL cache after setattr? Reproduction: #!/bin/bash touch testfile cat <testfile #!/bin/bash echo "Test was executed" EOF chmod u=rwx testfile chmod g=rw- testfile chmod o=r-- testfile chacl u::r--,g::rwx,o:rw- testfile chmod u+w testfile ls -ln testfile chacl -l testfile Output: -rw-rwxrw- 1 root root 0 Mar 28 05:29 testfile testfile [u::r--,g::rwx,o::rw-] Signed-off-by: chendt.fnst --- fs/nfs/nfs3proc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index 7327930..ef3e17c 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c @@ -140,6 +140,7 @@ status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0); if (status == 0) nfs_setattr_update_inode(inode, sattr, fattr); + forget_all_cached_acls(inode); dprintk("NFS reply setattr: %d\n", status); return status; }