From patchwork Wed Feb 20 07:29:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yangerkun X-Patchwork-Id: 10821565 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E548413B5 for ; Wed, 20 Feb 2019 07:25:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC3B529DA1 for ; Wed, 20 Feb 2019 07:25:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD77D2A7C8; Wed, 20 Feb 2019 07:25:19 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 5558529DA1 for ; Wed, 20 Feb 2019 07:25:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729770AbfBTHZS (ORCPT ); Wed, 20 Feb 2019 02:25:18 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:57740 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726315AbfBTHZS (ORCPT ); Wed, 20 Feb 2019 02:25:18 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 95B3741B1C8DFD95B5EB; Wed, 20 Feb 2019 15:25:14 +0800 (CST) Received: from RH5885H-V3.huawei.com (10.90.53.225) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.408.0; Wed, 20 Feb 2019 15:25:07 +0800 From: yangerkun To: , CC: , , , , Subject: [PATCH] nfs: drop acl cache in __nfs3_proc_setacls Date: Wed, 20 Feb 2019 15:29:25 +0800 Message-ID: <20190220072925.103352-1-yangerkun@huawei.com> X-Mailer: git-send-email 2.9.5 MIME-Version: 1.0 X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected 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 Since server may call posix_acl_update_mode which can lead acl been NULL. So,just drop acl cache after rpc_call_sync, and if anyone want to use acl, they can get the correct acl by send a msg to server themselves. This can fix xfstests generic/099 over nfsv3. Signed-off-by: yangerkun --- fs/nfs/nfs3acl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfs/nfs3acl.c b/fs/nfs/nfs3acl.c index 9fce185..6c07ebc 100644 --- a/fs/nfs/nfs3acl.c +++ b/fs/nfs/nfs3acl.c @@ -222,8 +222,8 @@ static int __nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl, switch (status) { case 0: status = nfs_refresh_inode(inode, fattr); - set_cached_acl(inode, ACL_TYPE_ACCESS, acl); - set_cached_acl(inode, ACL_TYPE_DEFAULT, dfacl); + /* Sever may call posix_acl_update_mode */ + forget_all_cached_acls(inode); break; case -EPFNOSUPPORT: case -EPROTONOSUPPORT: