Re: [PATCH v2 2/3] ntfs: restart the zone search when the allocation hint fails
From: Namjae Jeon
Date: Fri Oct 02 2026 - 20:19:11 EST
> diff --git a/fs/ntfs/lcnalloc.c b/fs/ntfs/lcnalloc.c
> index 0d6cd08ee2e7..c58e689fb585 100644
> --- a/fs/ntfs/lcnalloc.c
> +++ b/fs/ntfs/lcnalloc.c
> @@ -506,13 +506,32 @@ struct runlist_element *ntfs_cluster_alloc(struct ntfs_volume *vol, const s64 st
> }
>
> if (!used_zone_pos) {
> + /*
> + * The run at @start_lcn reached the end of the buffer
> + * or the zone. A contiguous request gets that run
> + * alone, not a second one from the zone position.
> + */
> + if (is_contig && rlpos)
> + goto out;
Could is_contig request still return noncontiguous runs after
used_zone_pos becomes 1? If the fallback run reaches a bitmap-page
boundary, goto next_bmp_pos can skip a fully used page and allow
another run from a later page. Since ntfs_attr_map_cluster() merges
all returned runs but reports only the first, could this leave the
second run unzeroed during fallocate()? Should we check adjacency
before setting the bitmap bit and return the existing short run when
contiguity breaks?
Thanks!