[PATCH v6 01/37] ntfs: propagate mapping-pairs update errors from inode writeback

From: Xuewen Wang

Date: Wed Nov 18 2026 - 04:07:54 EST


From: Xuewen Wang <wangxuewen@xxxxxxxxxx>

__ntfs_write_inode() overwrites a failed mapping-pairs update with the
result of syncing standard information. fsync() can then report success
while the mapping pairs remain dirty.

Check the update result after releasing the runlist lock and take the
existing error path. Preserve the errno and retry handling for ENOMEM.

Fixes: af0db57d4293 ("ntfs: update inode operations")
Reviewed-by: Baolin Liu <liubaolin@xxxxxxxxxx>
Signed-off-by: Xuewen Wang <wangxuewen@xxxxxxxxxx>
---
Changes in v6:
Keep the existing standalone writeback fix ahead of reporting helpers.

Validation:
- Compiled and linked the NTFS module object with W=1 at this stage.
- No undefined references to ntfs_report_* or fserror_report_*.

fs/ntfs/inode.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c
index 6a9f488e2775..ba1f78fc8c66 100644
--- a/fs/ntfs/inode.c
+++ b/fs/ntfs/inode.c
@@ -2974,6 +2974,8 @@ int __ntfs_write_inode(struct inode *vi, int sync)
if (!err)
NInoClearRunlistDirty(ni);
up_write(&ni->runlist.lock);
+ if (err)
+ goto unm_err_out;
}

err = ntfs_inode_sync_standard_information(vi, m);
--
2.51.0