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 8efe00b098 ("ntfs: preserve error code in
ntfs_resident_attr_record_add()").

Return PTR_ERR(ni_mrec) instead. Also fix the debug message.

Fixes: 495e90fa33 ("ntfs: update attrib operations")
Signed-off-by: Baolin Liu <liubaolin@kylinos.cn>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
This commit is contained in:
Baolin Liu 2026-09-04 17:00:53 +08:00 committed by Namjae Jeon
parent 5cd6692db2
commit 2db4627c57

View File

@ -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));