Re: [PATCH] ovl: say that only the capability to use reserved space is dropped
From: Amir Goldstein
Date: Tue Oct 20 2026 - 17:19:11 EST
On Tue, Oct 20, 2026 at 2:32 AM Cláudio Fernando Pinto via B4 Relay
<devnull+claudio.studiomoob.com@xxxxxxxxxx> wrote:
>
> From: Cláudio Fernando Pinto <claudio@xxxxxxxxxxxxxx>
>
> The comment above cap_lower(CAP_SYS_RESOURCE) in
> ovl_fill_super_creds(), added by commit 51f8f3c4e225 ("ovl: drop
> CAP_SYS_RESOURCE from saved mounter's credentials"), says overlayfs
> never uses reserved space. Lowering the capability does not stop ext4
> from granting its reserved blocks by fsuid: with the default reserve
> owner and a root mounter, a write through overlayfs still spends them.
> Say what the code does, without going further.
>
> Link: https://lore.kernel.org/linux-unionfs/CAOQ4uxh0g1MtgCO7Q2f4yJP5vq5rLEiiXHbVfeCxwXB5ff4-VQ@xxxxxxxxxxxxxx/
> Assisted-by: LLM
> Signed-off-by: Cláudio Fernando Pinto <claudio@xxxxxxxxxxxxxx>
> ---
> Follow-up to the reserve report after Amir's reply: comment only.
> ---
> fs/overlayfs/super.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
> index bd0a3f9039..21d0cb8719 100644
> --- a/fs/overlayfs/super.c
> +++ b/fs/overlayfs/super.c
> @@ -1508,7 +1508,7 @@ static int ovl_fill_super_creds(struct fs_context *fc, struct super_block *sb)
> else if (!ofs->nofh)
> sb->s_export_op = &ovl_export_fid_operations;
>
> - /* Never override disk quota limits or use reserved space */
> + /* Never override disk quota limits or use reserved space by capability */
> cap_lower(creator_cred->cap_effective, CAP_SYS_RESOURCE);
>
Look Cláudio, I know you have good intentions here, but I cannot help
it not being annoyed from a patch like that.
Comments are made for people who read the code and help them
to understand the code better.
Find one person on the planet that understands the code better because of
the two added words.
Come on! Don't send patches for the purpose of sending patches.
You want to do good, then find a way to make something better.
Sorry for the tone, too many real bugs to deal with.
Feel free to try again. I don't promise to like it better ;)
Thanks,
Amir.