Re: [PATCH] vfs: allow stacked ->get_acl() in RCU lookup

From: Miklos Szeredi
Date: Mon Apr 12 2021 - 05:46:08 EST


On Tue, Mar 23, 2021 at 5:07 PM Miklos Szeredi <mszeredi@xxxxxxxxxx> wrote:
>
> Overlayfs does not cache ACL's to avoid double caching with all its
> problems. Instead it just calls the underlying filesystem's
> i_op->get_acl(), which will return the cached value, if possible.
>
> In rcu path walk, however, get_cached_acl_rcu() is employed to get the
> value from the cache, which will fail on overlayfs resulting in dropping
> out of rcu walk mode. This can result in a big performance hit in certain
> situations.
>
> Add a flags argument to the ->get_acl() callback, and allow
> get_cached_acl_rcu() to call the ->get_acl() method with LOOKUP_RCU.
>
> Don't do this for the generic case of a cache miss, only in case of
> ACL_DONT_CACHE.
>
> Reported-by: garyhuang <zjh.20052005@xxxxxxx>
> Signed-off-by: Miklos Szeredi <mszeredi@xxxxxxxxxx>

Hi Al,

Could you please apply this patch?

It's fairly trivial, but unfortunately adds a fair bit of API churn.

Thanks,
Miklos