Re: [PATCH v3] ntfs: fix error handling in ntfs_extent_inode_open and propagate errors
From: Hyunchul Lee
Date: Mon Sep 07 2026 - 06:14:02 EST
2026년 9월 7일 (월) 오후 12:01, Baolin Liu <liubaolin12138@xxxxxxx>님이 작성:
>
> From: Baolin Liu <liubaolin@xxxxxxxxxx>
>
> ntfs_extent_inode_open() has two issues:
>
> 1. When map_mft_record() fails or a stale extent reference is found,
> it returns the non-NULL 'ni' pointer instead of an error, causing
> the caller to treat the failure as success.
>
> 2. For allocation failures, it returns NULL, losing information about
> what actually went wrong (-ENOMEM).
>
> Fix both by converting the function to return ERR_PTR() on error, and
> update the single caller (ntfs_inode_attach_all_extents) to check with
> IS_ERR() and propagate the actual error code with PTR_ERR().
>
> Fixes: af0db57d4293 ("ntfs: update inode operations")
> Signed-off-by: Baolin Liu <liubaolin@xxxxxxxxxx>
Looks good to me.
Reviewed-by: Hyunchul Lee <hyc.lee@xxxxxxxxx>
--
Thanks,
Hyunchul