Re: [PATCH v3] ntfs: fix error handling in ntfs_extent_inode_open and propagate errors
From: Namjae Jeon
Date: Mon Sep 07 2026 - 07:57:18 EST
On Mon, Sep 7, 2026 at 12:01 PM Baolin Liu <liubaolin12138@xxxxxxx> wrote:
>
> 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>
Applied it to #ntfs-next.
Thanks!