mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] ntfs: wire up the fileattr API
@ 2026-09-01  9:15 Baolin Liu
  2026-09-01  9:15 ` [PATCH 1/2] ntfs: implement fileattr_get and fileattr_set Baolin Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Baolin Liu @ 2026-09-01  9:15 UTC (permalink / raw)
  To: linkinjeon, hyc.lee; +Cc: ntfs, linux-kernel, liubaolin12138, Baolin Liu

From: Baolin Liu <liubaolin@kylinos.cn>

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.

Tested in QEMU on an NTFS volume, both with chattr(1)/lsattr(1) and with
a test binary issuing the ioctls directly:
 - chattr +i/+a/+d each set the flag and lsattr reads it back
 - appending to a +i file fails with EPERM
 - statx(2) reports STATX_ATTR_NODUMP once nodump is set, and stops
   reporting it once cleared
 - FS_COMPR_FL is rejected with EOPNOTSUPP
 - lsattr reports 'c' on a compressed file
 - chattr -i/-a/-d clear the flags, and a flag set before unmounting is
   gone after dropping caches and mounting again

Baolin Liu (2):
  ntfs: implement fileattr_get and fileattr_set
  ntfs: support the nodump flag

 fs/ntfs/file.c  | 65 ++++++++++++++++++++++++++++++++++++++++++++++++-
 fs/ntfs/inode.c |  1 +
 fs/ntfs/inode.h |  1 +
 fs/ntfs/ntfs.h  |  4 +++
 4 files changed, 70 insertions(+), 1 deletion(-)

-- 
2.51.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-09-09  4:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-01  9:15 [PATCH 0/2] ntfs: wire up the fileattr API Baolin Liu
2026-09-01  9:15 ` [PATCH 1/2] ntfs: implement fileattr_get and fileattr_set Baolin Liu
2026-09-02  1:22   ` Namjae Jeon
2026-09-02  6:44     ` liubaolin
2026-09-02  2:00   ` Hyunchul Lee
2026-09-02  7:25     ` liubaolin
2026-09-01  9:15 ` [PATCH 2/2] ntfs: support the nodump flag Baolin Liu
2026-09-02  1:44 ` [PATCH 0/2] ntfs: wire up the fileattr API Namjae Jeon
2026-09-02  7:26   ` liubaolin
2026-09-08  8:31   ` liubaolin
2026-09-09  4:48     ` Namjae Jeon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®