]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: Massage the minimize for XFS a bit 28839/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 15 Aug 2023 10:58:28 +0000 (12:58 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 15 Aug 2023 10:58:28 +0000 (12:58 +0200)
A 1.5 multiplier doesn't seem to be sufficient for XFS as seen in
mkosi CI. Let's increase it to 2 for XFS to hopefully get better
results.

src/partition/repart.c

index a9d5526700fffd1c277a633ff005dd5c3caa350a..4eced612b9951f2e1f0dbaf4dc2c9fb2b3d679db 100644 (file)
@@ -6107,7 +6107,8 @@ static int context_minimize(Context *context) {
 
                 /* Massage the size a bit because just going by actual data used in the sparse file isn't
                  * fool-proof. */
-                fsz = round_up_size(fsz + (fsz / 2), context->grain_size);
+                uint64_t heuristic = streq(p->format, "xfs") ? fsz : fsz / 2;
+                fsz = round_up_size(fsz + heuristic, context->grain_size);
                 if (minimal_size_by_fs_name(p->format) != UINT64_MAX)
                         fsz = MAX(minimal_size_by_fs_name(p->format), fsz);