From: Konstantin Komarov Date: Fri, 12 Dec 2025 11:27:48 +0000 (+0300) Subject: fs/ntfs3: drop preallocated clusters for sparse and compressed files X-Git-Tag: v6.19.6~443 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=824ed8d874f5c2e9ea8511540e88b6df7bbf1f72;p=thirdparty%2Fkernel%2Fstable.git fs/ntfs3: drop preallocated clusters for sparse and compressed files [ Upstream commit 3a6aba7f3cf2b46816e08548c254d98de9c74eba ] Do not keep preallocated clusters for sparsed and compressed files. Preserving preallocation in these cases causes fsx failures when running with sparse files and preallocation enabled. Signed-off-by: Konstantin Komarov Signed-off-by: Sasha Levin --- diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c index c45880ab23912..0cd15a0983fee 100644 --- a/fs/ntfs3/attrib.c +++ b/fs/ntfs3/attrib.c @@ -448,8 +448,10 @@ again: is_ext = is_attr_ext(attr_b); align = sbi->cluster_size; - if (is_ext) + if (is_ext) { align <<= attr_b->nres.c_unit; + keep_prealloc = false; + } old_valid = le64_to_cpu(attr_b->nres.valid_size); old_size = le64_to_cpu(attr_b->nres.data_size);