]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fs/ntfs3: drop preallocated clusters for sparse and compressed files
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Fri, 12 Dec 2025 11:27:48 +0000 (14:27 +0300)
committerSasha Levin <sashal@kernel.org>
Wed, 4 Mar 2026 12:20:44 +0000 (07:20 -0500)
[ 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 <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ntfs3/attrib.c

index c45880ab2391277327494b8016d23e3cc066de47..0cd15a0983fee3d49a49c01f217324cc575ad4c3 100644 (file)
@@ -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);