[PATCH v1 0/9] ntfs: assorted error path fixes

Baolin Liu posted 9 patches 1 month, 1 week ago
fs/ntfs/attrib.c   |  4 ++--
fs/ntfs/ea.c       | 18 +++++++++++-------
fs/ntfs/lcnalloc.c |  9 +++++----
fs/ntfs/mft.c      |  4 +++-
fs/ntfs/reparse.c  |  7 ++++---
5 files changed, 25 insertions(+), 17 deletions(-)
[PATCH v1 0/9] ntfs: assorted error path fixes
Posted by Baolin Liu 1 month, 1 week ago
From: Baolin Liu <liubaolin@kylinos.cn>

This series fixes a number of problems on error paths in the ntfs
driver: errors that are swallowed or collapsed so operations report
success or a wrong errno (patches 1-6), a kmap_local leak (patch 7),
and free cluster miscounting on failed frees (patches 8-9).

Baolin Liu (9):
  ntfs: return DT_UNKNOWN on inode lookup failure in readdir
  ntfs: fail EA update when reading $EA_INFORMATION fails
  ntfs: propagate reparse index insertion failure
  ntfs: return -ERANGE for undersized xattr buffer
  ntfs: preserve error code in ntfs_resident_attr_record_add()
  ntfs: return real error from ntfs_non_resident_attr_record_add()
  ntfs: fix kmap_local leak in write_mft_record_nolock() error paths
  ntfs: only count successfully cleared runs when freeing clusters
  ntfs: skip free cluster decrement when rollback fails

 fs/ntfs/attrib.c   |  4 ++--
 fs/ntfs/ea.c       | 18 +++++++++++-------
 fs/ntfs/lcnalloc.c |  9 +++++----
 fs/ntfs/mft.c      |  4 +++-
 fs/ntfs/reparse.c  |  7 ++++---
 5 files changed, 25 insertions(+), 17 deletions(-)

-- 
2.51.0
Re: [PATCH v1 0/9] ntfs: assorted error path fixes
Posted by Namjae Jeon 1 month ago
On Fri, Aug 21, 2026 at 2:32 PM Baolin Liu <liubaolin12138@163.com> wrote:
>
> From: Baolin Liu <liubaolin@kylinos.cn>
>
> This series fixes a number of problems on error paths in the ntfs
> driver: errors that are swallowed or collapsed so operations report
> success or a wrong errno (patches 1-6), a kmap_local leak (patch 7),
> and free cluster miscounting on failed frees (patches 8-9).
>
> Baolin Liu (9):
>   ntfs: return DT_UNKNOWN on inode lookup failure in readdir
>   ntfs: fail EA update when reading $EA_INFORMATION fails
>   ntfs: propagate reparse index insertion failure
>   ntfs: return -ERANGE for undersized xattr buffer
>   ntfs: preserve error code in ntfs_resident_attr_record_add()
>   ntfs: return real error from ntfs_non_resident_attr_record_add()
>   ntfs: fix kmap_local leak in write_mft_record_nolock() error paths
>   ntfs: only count successfully cleared runs when freeing clusters
>   ntfs: skip free cluster decrement when rollback fails

Applied them except 0002 patch to #ntfs-next.
Could you please recreate 0002 patch based on the #ntfs-next branch?

Thanks.
Re: [PATCH v1 0/9] ntfs: assorted error path fixes
Posted by liubaolin 1 month ago

在 2026/8/26 19:21, Namjae Jeon 写道:
> On Fri, Aug 21, 2026 at 2:32 PM Baolin Liu <liubaolin12138@163.com> wrote:
>>
>> From: Baolin Liu <liubaolin@kylinos.cn>
>>
>> This series fixes a number of problems on error paths in the ntfs
>> driver: errors that are swallowed or collapsed so operations report
>> success or a wrong errno (patches 1-6), a kmap_local leak (patch 7),
>> and free cluster miscounting on failed frees (patches 8-9).
>>
>> Baolin Liu (9):
>>    ntfs: return DT_UNKNOWN on inode lookup failure in readdir
>>    ntfs: fail EA update when reading $EA_INFORMATION fails
>>    ntfs: propagate reparse index insertion failure
>>    ntfs: return -ERANGE for undersized xattr buffer
>>    ntfs: preserve error code in ntfs_resident_attr_record_add()
>>    ntfs: return real error from ntfs_non_resident_attr_record_add()
>>    ntfs: fix kmap_local leak in write_mft_record_nolock() error paths
>>    ntfs: only count successfully cleared runs when freeing clusters
>>    ntfs: skip free cluster decrement when rollback fails
> 
> Applied them except 0002 patch to #ntfs-next.
> Could you please recreate 0002 patch based on the #ntfs-next branch?
> 
> Thanks.

Hi Namjae,

    The 0002 patch has been recreated on top of ntfs-next and sent as
    "[PATCH v2] ntfs: leave HasEA flag untouched on setxattr failure".

    Note that the subject changed: on ntfs-next, the -EIO return for a
    failed $EA_INFORMATION read is already handled by 56cc42a7b387
    ("ntfs: return errors from ntfs_attr_readall"), so only the HasEA
    flag part of the original patch remains.

Thanks,
Baolin

Re: [PATCH v1 0/9] ntfs: assorted error path fixes
Posted by liubaolin 1 month ago

在 2026/8/26 19:21, Namjae Jeon 写道:
> On Fri, Aug 21, 2026 at 2:32 PM Baolin Liu <liubaolin12138@163.com> wrote:
>>
>> From: Baolin Liu <liubaolin@kylinos.cn>
>>
>> This series fixes a number of problems on error paths in the ntfs
>> driver: errors that are swallowed or collapsed so operations report
>> success or a wrong errno (patches 1-6), a kmap_local leak (patch 7),
>> and free cluster miscounting on failed frees (patches 8-9).
>>
>> Baolin Liu (9):
>>    ntfs: return DT_UNKNOWN on inode lookup failure in readdir
>>    ntfs: fail EA update when reading $EA_INFORMATION fails
>>    ntfs: propagate reparse index insertion failure
>>    ntfs: return -ERANGE for undersized xattr buffer
>>    ntfs: preserve error code in ntfs_resident_attr_record_add()
>>    ntfs: return real error from ntfs_non_resident_attr_record_add()
>>    ntfs: fix kmap_local leak in write_mft_record_nolock() error paths
>>    ntfs: only count successfully cleared runs when freeing clusters
>>    ntfs: skip free cluster decrement when rollback fails
> 
> Applied them except 0002 patch to #ntfs-next.
> Could you please recreate 0002 patch based on the #ntfs-next branch?
> 
> Thanks.

Thanks for reviewing and applying the series. I'll recreate patch 0002 
based on the current #ntfs-next branch and send it shortly.

Thanks,
Baolin.