From 2db4627c57d608df40647f553a3b5cad1691c1c6 Mon Sep 17 00:00:00 2001 From: Baolin Liu Date: Fri, 4 Sep 2026 17:00:53 +0800 Subject: [PATCH] ntfs: propagate the map_mft_record() error in ntfs_attrlist_entry_add() ntfs_attrlist_entry_add() replaces the map_mft_record() error with -EIO, so an -ENOMEM allocation failure is reported as an I/O error. Both callers pass the value on to ntfs_attr_add(), which no longer collapses it since commit 8efe00b098b5 ("ntfs: preserve error code in ntfs_resident_attr_record_add()"). Return PTR_ERR(ni_mrec) instead. Also fix the debug message. Fixes: 495e90fa3348 ("ntfs: update attrib operations") Signed-off-by: Baolin Liu Reviewed-by: Hyunchul Lee Signed-off-by: Namjae Jeon --- fs/ntfs/attrlist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ntfs/attrlist.c b/fs/ntfs/attrlist.c index bb191953dcb1..7c09d02fd941 100644 --- a/fs/ntfs/attrlist.c +++ b/fs/ntfs/attrlist.c @@ -335,8 +335,8 @@ int ntfs_attrlist_entry_add(struct ntfs_inode *ni, struct attr_record *attr) ni_mrec = map_mft_record(ni); if (IS_ERR(ni_mrec)) { - ntfs_debug("Invalid arguments.\n"); - return -EIO; + ntfs_debug("Failed to map mft record.\n"); + return PTR_ERR(ni_mrec); } mref = MK_LE_MREF(ni->mft_no, le16_to_cpu(ni_mrec->sequence_number));