[Ocfs2-devel] [PATCH] ocfs2: drop acl cache for directories too
Joseph Qi
joseph.qi at linux.alibaba.com
Mon Sep 6 04:42:43 PDT 2021
On 9/3/21 9:26 AM, Wengang Wang wrote:
> 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
>
> Signed-off-by: Wengang Wang <wen.gang.wang at oracle.com>
Looks sane to me.
Reviewed-by: Joseph Qi <joseph.qi at linux.alibaba.com>
> ---
> fs/ocfs2/dlmglue.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
> index 50a863fc1779..207ec61569ea 100644
> --- a/fs/ocfs2/dlmglue.c
> +++ b/fs/ocfs2/dlmglue.c
> @@ -3933,7 +3933,7 @@ static int ocfs2_data_convert_worker(struct ocfs2_lock_res *lockres,
> 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))
> @@ -3964,6 +3964,7 @@ static int ocfs2_data_convert_worker(struct ocfs2_lock_res *lockres,
> filemap_fdatawait(mapping);
> }
>
> +out_forget:
> forget_all_cached_acls(inode);
>
> out:
>
More information about the Ocfs2-devel
mailing list