Re: [PATCH 1/7] ntfs: release delalloc reservations cut off by truncate

From: Ernest Borowski

Date: Tue Nov 24 2026 - 07:38:56 EST


On Mon, Nov 23, 2026 at 11:16:17AM +0900, Hyunchul Lee wrote:
> If ntfs_cluster_alloc() succeeds for a LCN_DEALLOC run but the
> subsequent kmemdup() in ntfs_attr_map_cluster() fails, the reservation
> has already been substracted from dirty_clusters but LCN_DELLOC run
> remains.
>
> Is this planned to be addressed in part 2?

Yes. This is pre-existing (ntfs-next has the same path), and the first
patch of part 2, "ntfs: keep delalloc reservations when a cluster
allocation fails", fixes it. When the runlist copy (kmemdup()), the
runlist merge or the mapping pairs update fails after the allocator has
taken a delalloc reservation, ntfs_attr_map_cluster() restores the
reservation before freeing the clusters. The same patch stops
ntfs_cluster_alloc() from setting vol->dirty_clusters to 0 when it fails
after the free space check. A fail-nth reproducer covers these paths.

If you would rather have it here, I can move it into v2 of this series.

Thanks,
Ernest