Re: [PATCH 0/2] ntfs: wire up the fileattr API
From: liubaolin
Date: Wed Sep 02 2026 - 03:32:03 EST
在 2026/9/2 09:44, Namjae Jeon 写道:
On Tue, Sep 1, 2026 at 6:15 PM Baolin Liu <liubaolin12138@xxxxxxx> wrote:
This patch-set does not persist these flags on disk. So, the settings
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.
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?
Hi Namjae,
You are right about inode reclaim, I had not considered that - not just
a remount, memory pressure or drop_caches can silently drop these flags
as well.
I will look into how to persist them without breaking compatibility.
Thanks for the review.
Thanks,
Baolin