mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/6] ntfs: report filesystem errors through fsnotify
@ 2026-09-24  9:00 Baolin Liu
  2026-09-24  9:00 ` [PATCH v3 1/6] ntfs: report allocation metadata errors to fsnotify Baolin Liu
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Baolin Liu @ 2026-09-24  9:00 UTC (permalink / raw)
  To: linkinjeon, hyc.lee; +Cc: ntfs, linux-kernel, Baolin Liu

From: Baolin Liu <liubaolin@kylinos.cn>

Report NTFS metadata and shutdown errors through the generic filesystem
error notification infrastructure. Use file-level events for errors
associated with an affected inode, and volume-level events for volume
metadata and shutdown errors. Preserve the volume error flags and report
failed recovery independently of the error that triggered it.

Report errors where they are detected and leave queued event merging to
fanotify. No error_reported state is carried through search contexts,
mapping-pairs updates or MFT mappings, so releasing a context cannot lose
that state or suppress a later rollback or restore failure.

Changes since v2:
- Follow Hyunchul Lee's suggestion to remove error_reported tracking and
  the reporting-aware mapping APIs throughout the series.
- Report independent cluster, mapping-pairs, ATTRIBUTE_LIST and MFT
  bitmap recovery failures while preserving the original operation errno.
- Base the series on ntfs-next at 401898d748fc ("ntfs: validate
  attribute-list sizes before allocation"). Retain its MFT parent BIO
  and folio writeback implementation. Report synchronous and asynchronous
  device errors in the existing completion callback; fserror itself
  defers notification work and holds the inode reference. No additional
  NTFS completion workqueue or pending-I/O counter is introduced.
- Cover stale extent references, failed extent-record cleanup, mirror
  failures and MFT preparation errors. Resolve attribute-inode reports
  to their base inode and keep cluster-free counts in 64-bit variables.
- Split MFT reporting into two patches: metadata validation, allocation
  and recovery in patch 4; write preparation, mirror and BIO completion
  errors in patch 5. This keeps the two review topics separate.
  Shutdown reporting is now patch 6.

Testing on this base:
- QEMU passed mount/read/write/fsync/truncate/xattr/rename/unlink, MFT
  growth and unmount without FAN_FS_ERROR events during normal operation.
- Verified EIO with a valid FID for file MFT corruption, EUCLEAN without
  a valid FID for an MFT bitmap mismatch, and ESHUTDOWN for forced
  shutdown.
- Fault injection of an initial mapping-pairs error followed by an
  independent restore failure produced a merged FAN_FS_ERROR event with
  error_count=2. Synchronous and asynchronous MFT completion failures
  also generated notifications. The injection code is test-only and is
  excluded from the series.

Baolin Liu (6):
  ntfs: report allocation metadata errors to fsnotify
  ntfs: report attribute errors to fsnotify
  ntfs: report inode metadata errors to fsnotify
  ntfs: report MFT metadata and recovery errors to fsnotify
  ntfs: report MFT writeback errors to fsnotify
  ntfs: report shutdown errors to fsnotify

 fs/ntfs/attrib.c   |  84 ++++++++++++++------
 fs/ntfs/attrlist.c |  17 ++--
 fs/ntfs/bitmap.c   |   2 +-
 fs/ntfs/inode.c    |  12 ++-
 fs/ntfs/lcnalloc.c |   4 +-
 fs/ntfs/logfile.c  |   2 +-
 fs/ntfs/mft.c      | 192 ++++++++++++++++++++++++++++-----------------
 fs/ntfs/super.c    |  32 +++++++-
 fs/ntfs/volume.h   |   4 +
 9 files changed, 235 insertions(+), 114 deletions(-)

-- 
2.51.0


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

end of thread, other threads:[~2026-09-26 13:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-24  9:00 [PATCH v3 0/6] ntfs: report filesystem errors through fsnotify Baolin Liu
2026-09-24  9:00 ` [PATCH v3 1/6] ntfs: report allocation metadata errors to fsnotify Baolin Liu
2026-09-24  9:00 ` [PATCH v3 2/6] ntfs: report attribute " Baolin Liu
2026-09-24  9:00 ` [PATCH v3 3/6] ntfs: report inode metadata " Baolin Liu
2026-09-24  9:01 ` [PATCH v3 4/6] ntfs: report MFT metadata and recovery " Baolin Liu
2026-09-26  0:36   ` Hyunchul Lee
2026-09-26 12:43     ` liubaolin
2026-09-24  9:01 ` [PATCH v3 5/6] ntfs: report MFT writeback " Baolin Liu
2026-09-24  9:01 ` [PATCH v3 6/6] ntfs: report shutdown " Baolin Liu
2026-09-26  0:40   ` Hyunchul Lee
2026-09-26 12:52     ` liubaolin
2026-09-26  0:33 ` [PATCH v3 0/6] ntfs: report filesystem errors through fsnotify Hyunchul Lee
2026-09-26 13:49   ` liubaolin

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®