Re: [PATCH v1 1/9] ntfs: return DT_UNKNOWN on inode lookup failure in readdir

Hyunchul Lee <[email protected]>
Newsgroups org.kernel.vger.linux-kernel,dev.linux.lists.ntfs
Message-ID <CANFS6bbeWMLV3jStN40oKo1qfK5Eiy_bONevEmmeshcFxjtt1w@mail.gmail.com>
2026년 8월 21일 (금) 오후 2:33, Baolin Liu <[email protected]>님이 작성:
>
> From: Baolin Liu <[email protected]>
>
> ntfs_reparse_tag_dt_types() returns PTR_ERR(vi) when ntfs_iget()
> fails, but its return type is unsigned int and the caller passes
> the value straight to dir_emit() as d_type. A stale or corrupt MFT
> reference in a directory index thus makes readdir report a garbage
> d_type value to userspace.
>
> Return DT_UNKNOWN on lookup failure instead.
>
> Fixes: fc053f05ca28 ("ntfs: add reparse and ea operations")
> Signed-off-by: Baolin Liu <[email protected]>

Looks good to me.

Reviewed-by: Hyunchul Lee <[email protected]>

> ---
>  fs/ntfs/reparse.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ntfs/reparse.c b/fs/ntfs/reparse.c
> index 0d3988992119..a8e413c61353 100644
> --- a/fs/ntfs/reparse.c
> +++ b/fs/ntfs/reparse.c
> @@ -331,7 +331,7 @@ unsigned int ntfs_reparse_tag_dt_types(struct ntfs_volume *vol, unsigned long mr
>
>         vi = ntfs_iget(vol->sb, mref);
>         if (IS_ERR(vi))
> -               return PTR_ERR(vi);
> +               return DT_UNKNOWN;
>
>         reparse_attr = (struct reparse_point *)ntfs_attr_readall(NTFS_I(vi),
>                         AT_REPARSE_POINT, NULL, 0, &attr_size);
> --
> 2.51.0
>
>


-- 
Thanks,
Hyunchul
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.