From patchwork Fri Sep 24 22:43:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12516963 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5900BC433F5 for ; Fri, 24 Sep 2021 22:43:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0835E61261 for ; Fri, 24 Sep 2021 22:43:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0835E61261 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 9BFCE6B007B; Fri, 24 Sep 2021 18:43:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 96F5C6B007D; Fri, 24 Sep 2021 18:43:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 837D06B007E; Fri, 24 Sep 2021 18:43:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0072.hostedemail.com [216.40.44.72]) by kanga.kvack.org (Postfix) with ESMTP id 71B096B007B for ; Fri, 24 Sep 2021 18:43:37 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 29DDE18036FF1 for ; Fri, 24 Sep 2021 22:43:37 +0000 (UTC) X-FDA: 78623945274.08.1C02363 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf25.hostedemail.com (Postfix) with ESMTP id D6299B000183 for ; Fri, 24 Sep 2021 22:43:36 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id B4E85610C7; Fri, 24 Sep 2021 22:43:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1632523416; bh=rA37PYHONDIG3MvsoHAzveB2Egr+eik4Izw0/KSpGnE=; h=Date:From:To:Subject:In-Reply-To:From; b=AkZeVTDSqx95emlo020iXkENsJudK1Ke/nbogy/fmcyrtgUHV7GVrx7i2BKWnyHD/ +h7lr/VHy3zEdtcc4+K1l/8GkkGf22jOVySWJVZtwOy110KBvdLEZ1n8TPf4vq/ahk BUTbK6005fWp2+fLwpsqBaSSpZ8nyiBqByzQS3VU= Date: Fri, 24 Sep 2021 15:43:35 -0700 From: Andrew Morton To: akpm@linux-foundation.org, gechangwei@live.cn, ghe@suse.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, junxiao.bi@oracle.com, linux-mm@kvack.org, mark@fasheh.com, mm-commits@vger.kernel.org, piaojun@huawei.com, stable@vger.kernel.org, torvalds@linux-foundation.org, wen.gang.wang@oracle.com Subject: [patch 06/16] ocfs2: drop acl cache for directories too Message-ID: <20210924224335.qEoBbK0p3%akpm@linux-foundation.org> In-Reply-To: <20210924154257.1dbf6699ab8d88c0460f924f@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: D6299B000183 X-Stat-Signature: y7h7yjrfibxufx4qeqwmqtd9s444i5hm Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=AkZeVTDS; dmarc=none; spf=pass (imf25.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-HE-Tag: 1632523416-32209 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Wengang Wang Subject: ocfs2: drop acl cache for directories too ocfs2_data_convert_worker() is currently dropping any cached acl info for FILE before down-converting meta lock. It should also drop for DIRECTORY. Otherwise the second acl lookup returns the cached one (from VFS layer) which could be already stale. The problem we are seeing is that the acl changes on one node doesn't get refreshed on other nodes in the following case: Node 1 Node 2 -------------- ---------------- getfacl dir1 getfacl dir1 <-- this is OK setfacl -m u:user1:rwX dir1 getfacl dir1 <-- see the change for user1 getfacl dir1 <-- can't see change for user1 Link: https://lkml.kernel.org/r/20210903012631.6099-1-wen.gang.wang@oracle.com Signed-off-by: Wengang Wang Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Cc: Signed-off-by: Andrew Morton --- fs/ocfs2/dlmglue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/ocfs2/dlmglue.c~ocfs2-drop-acl-cache-for-directories-too +++ a/fs/ocfs2/dlmglue.c @@ -3951,7 +3951,7 @@ static int ocfs2_data_convert_worker(str oi = OCFS2_I(inode); oi->ip_dir_lock_gen++; mlog(0, "generation: %u\n", oi->ip_dir_lock_gen); - goto out; + goto out_forget; } if (!S_ISREG(inode->i_mode)) @@ -3982,6 +3982,7 @@ static int ocfs2_data_convert_worker(str filemap_fdatawait(mapping); } +out_forget: forget_all_cached_acls(inode); out: