Re: [PATCH 0/2] ntfs: wire up the fileattr API

From: Namjae Jeon

Date: Tue Sep 01 2026 - 21:45:08 EST


On Tue, Sep 1, 2026 at 6:15 PM Baolin Liu <liubaolin12138@xxxxxxx> wrote:
>
> From: Baolin Liu <liubaolin@xxxxxxxxxx>
>
> This series implements fileattr_get and fileattr_set for ntfs so that
> lsattr(1) and chattr(1) work on ntfs.
>
> Patch 1 wires up the fileattr inode operations and implements support
> for FS_IMMUTABLE_FL and FS_APPEND_FL. These flags map to inode->i_flags
> (S_IMMUTABLE, S_APPEND), so the VFS enforces them. fileattr_get also
> reports the compressed and encrypted state, which the driver already
> exposes through STATX_ATTR_* in ntfs_getattr().
>
> Patch 2 adds FS_NODUMP_FL support, which dump(8) and other backup tools
> use to mark files to skip. The flag is stored in a new ntfs_inode field
> and reported through both fileattr_get (for lsattr) and ntfs_getattr()
> (as STATX_ATTR_NODUMP, for statx), so the two interfaces stay consistent.
>
> All three accepted flags (immutable, append-only, nodump) are kept in
> memory and do not survive a remount, matching ntfs3 behavior.
This patch-set does not persist these flags on disk. So, the settings
survive only while the corresponding inode remains cached. inode
reclaim caused by memory pressure or drop_caches can discard them
before unmount. Could you find a way to persist immutable, append, and
nodump in metadata without causing compatibility issues?