Re: [PATCH v5 09/12] fs,ntfs: advertise COMPR/ENCRYPT xflags in file_getattr()
From: Amir Goldstein
Date: Sat Dec 05 2026 - 15:42:14 EST
On Sat, Dec 5, 2026 at 9:21 PM Amir Goldstein <amir73il@xxxxxxxxx> wrote:
>
> On Sat, Dec 5, 2026 at 3:25 PM koraynilay <koray.fra@xxxxxxxxx> wrote:
> >
> > Introduce FS_XFLAG_COMPR and FS_XFLAG_ENCRYPT and update
> > fileattr_fill_*() helpers so file_getattr() and FS_IOC_FSGETXATTR
> > advertise them too, in preparation for upgrading ntfs to the masks
> > API ([1] and newer versions).
> >
> > Since FS_COMPR_FL is read-write only with FS_IOC_SETFLAGS for some
> > filesystems, put it in FSX_RDONLY_MASK but not in FSX_COMMON,
> > following the FS_XFLAG_CASEFOLD example.
> >
> > Since FS_ENCRYPT_FL is read-only with both FS_IOC_SETFLAGS and
> > FS_IOC_FSSETXATTR/file_setattr(), put it in both FSX_RDONLY_MASK and
> > FSX_COMMON, following the FS_XFLAG_VERITY example.
> >
> > Since during FS_IOC_FSSETXATTR and file_setattr() (without masks) the
> > VFS strips these new xflags (because they're both in FSX_RDONLY_MASK),
> > ntfs sees this as a change on already compressed or encrypted files and
> > rejects the operation. Fix this by checking for fa->flags_valid.
> >
> > Link: https://lore.kernel.org/20261122000856.536902-1-koray.fra@xxxxxxxxx/ [1]
> > Reviewed-by: Amir Goldstein <amir73il@xxxxxxxxx>
> > Signed-off-by: koraynilay <koray.fra@xxxxxxxxx>
> > ---
> >
> > Amir, I kept your RVB since I just copy pasted your change, but tell me
> > if I should've dropped it.
>
> It's fine
Only the fs,ntfs: change it to fs: please
Thanks,
Amir.