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

Baolin Liu posted 5 patches 1 week, 2 days ago
There is a newer version of this series
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(-)
[PATCH v2 0/5] ntfs: report filesystem errors through fsnotify
Posted by Baolin Liu 1 week, 2 days ago
From: Baolin Liu <liubaolin@kylinos.cn>

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
Re: [PATCH v2 0/5] ntfs: report filesystem errors through fsnotify
Posted by liubaolin 1 week, 2 days ago

在 2026/9/16 10:23, Baolin Liu 写道:
> From: Baolin Liu <liubaolin@kylinos.cn>
> 
> 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(-)
> 

Hi Namjae and Hyunchul,

   Thank you, Hyunchul, for reviewing the v1 patch series and providing 
helpful feedback.

   Based on your comments, I reorganized the series for v2. Patch 1 now 
contains only the volume-level helper and non-file allocation metadata 
errors. The file-level helper is introduced in patch 2, and file-related 
error reporting is split among the attribute, inode, and MFT patches. 
Shutdown reporting remains separate in patch 5. I also expanded the 
commit messages and tested the notifications with fanotify in QEMU.

   I have now submitted the v2 patch series. Your review and any further 
discussion would be very welcome. I look forward to hearing your 
comments and suggestions.

Thanks,
Baolin.