Re: [PATCH] fs: reset read-only fsflags together with xflags

From: Eric Biggers

Date: Sat Jan 24 2026 - 13:30:19 EST


On Wed, Jan 21, 2026 at 08:36:43PM +0100, Andrey Albershteyn wrote:
> While setting file attributes, the read-only flags are reset
> for ->xflags, but not for ->flags if flag is shared between both. This
> is fine for now as all read-only xflags don't overlap with flags.
> However, for any read-only shared flag this will create inconsistency
> between xflags and flags. The non-shared flag will be reset in
> vfs_fileattr_set() to the current value, but shared one is past further
> to ->fileattr_set.
>
> Reported-by: Eric Biggers <ebiggers@xxxxxxxxxx>
> Signed-off-by: Andrey Albershteyn <aalbersh@xxxxxxxxxx>
> ---
>
> The shared read-only flag is going to be added for fsverity. The one for ->flags
> already exists.
>
> [1]: https://lore.kernel.org/linux-xfs/20260119165644.2945008-2-aalbersh@xxxxxxxxxx/

Reviewed-by: Eric Biggers <ebiggers@xxxxxxxxxx>

- Eric