mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Baolin Liu <liubaolin12138@163.com>
To: linkinjeon@kernel.org, hyc.lee@gmail.com
Cc: ntfs@lists.linux.dev, linux-kernel@vger.kernel.org,
	Baolin Liu <liubaolin@kylinos.cn>
Subject: [PATCH v3 0/6] ntfs: report filesystem errors through fsnotify
Date: Thu, 24 Sep 2026 17:00:56 +0800	[thread overview]
Message-ID: <20260924090102.2865942-1-liubaolin12138@163.com> (raw)

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


             reply	other threads:[~2026-09-24  9:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24  9:00 Baolin Liu [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260924090102.2865942-1-liubaolin12138@163.com \
    --to=liubaolin12138@163.com \
    --cc=hyc.lee@gmail.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liubaolin@kylinos.cn \
    --cc=ntfs@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®