]> git.ipfire.org Git - thirdparty/kernel/linux.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)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Mon, 29 Dec 2025 13:33:29 +0000 (13:33 +0000)
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>
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);