From mboxrd@z Thu Jan 1 00:00:00 1970 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 B6DDAC433FE for ; Mon, 4 Oct 2021 13:00:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A0BCE619F5 for ; Mon, 4 Oct 2021 13:00:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234213AbhJDNCe (ORCPT ); Mon, 4 Oct 2021 09:02:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:59724 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234216AbhJDNBJ (ORCPT ); Mon, 4 Oct 2021 09:01:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 517B06159A; Mon, 4 Oct 2021 12:58:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633352301; bh=Enq9mWUvBFrvfs1frWLRu3MjOPqxOAxSZBzUH3SnHrU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U3VXgg9hFHjtKIo8lHH32Nl6sT9VdUU3b2XkmobJuGIKf+P/a7+oalTnr4zAhRdsN Oy7zKH9RvUoTP7mkEk7+4KTPbRb4/100dNEGfv4zZW+orfh3h3kUo+rSayuBniQl18 uAd/REm2Kt1h7MjDmP1ZxFpkydMo52yjwox/0jH0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wengang Wang , Joseph Qi , Mark Fasheh , Joel Becker , Junxiao Bi , Changwei Ge , Gang He , Jun Piao , Andrew Morton , Linus Torvalds Subject: [PATCH 4.14 01/75] ocfs2: drop acl cache for directories too Date: Mon, 4 Oct 2021 14:51:36 +0200 Message-Id: <20211004125031.580379412@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125031.530773667@linuxfoundation.org> References: <20211004125031.530773667@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Wengang Wang commit 9c0f0a03e386f4e1df33db676401547e1b7800c6 upstream. 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 Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- fs/ocfs2/dlmglue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -3705,7 +3705,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)) @@ -3736,6 +3736,7 @@ static int ocfs2_data_convert_worker(str filemap_fdatawait(mapping); } +out_forget: forget_all_cached_acls(inode); out: