[PATCH v2 0/5] ntfs: report filesystem errors through fsnotify

From: Baolin Liu

Date: Tue Sep 15 2026 - 22:24:19 EST


From: Baolin Liu <liubaolin@xxxxxxxxxx>

Report NTFS metadata and shutdown errors through the generic filesystem
error notification infrastructure. Use volume-level events when no
affected file is available and file-level events when an inode identifies
the failure.

Split the reporting by allocation, attribute, inode, MFT, and shutdown
domains. Propagate reporting state through attribute searches,
mapping-pairs updates, and MFT mappings so callers do not emit duplicate
events.

Changes since v1:
- Restrict patch 1 to the volume helper and non-file allocation rollbacks.
- Introduce the file helper with attribute reporting in patch 2.
- Separate inode and MFT reporting into patches 3 and 4.
- Adapt MFT writeback reporting to the current asynchronous I/O path.
- Keep shutdown reporting independent in patch 5.

Testing:
- Built fs/ntfs with W=1 after each patch.
- Booted the patched kernel in QEMU and monitored FAN_FS_ERROR events on
an NTFS volume with fanotify. Verified that volume metadata errors report
EIO without a valid file handle, file metadata errors report EIO with a
valid FID, and shutdown errors report ESHUTDOWN.

Baolin Liu (5):
ntfs: report allocation metadata errors to fsnotify
ntfs: report attribute errors to fsnotify
ntfs: report inode metadata errors to fsnotify
ntfs: report MFT errors to fsnotify
ntfs: report shutdown errors to fsnotify

fs/ntfs/attrib.c | 88 +++++++++++-----
fs/ntfs/attrib.h | 6 ++
fs/ntfs/attrlist.c | 16 +--
fs/ntfs/bitmap.c | 2 +-
fs/ntfs/inode.c | 62 +++++++----
fs/ntfs/lcnalloc.c | 4 +-
fs/ntfs/logfile.c | 2 +-
fs/ntfs/mft.c | 252 ++++++++++++++++++++++++++++++---------------
fs/ntfs/mft.h | 6 ++
fs/ntfs/super.c | 27 ++++-
fs/ntfs/volume.h | 4 +
11 files changed, 329 insertions(+), 140 deletions(-)

--
2.51.0