From: Yu Watanabe Date: Sun, 9 Nov 2025 16:52:19 +0000 (+0900) Subject: repart: Correctly handle btrfs compression (#39597) X-Git-Tag: v259-rc1~119 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=445b7073c7b6ddac9d033ff9cb83c6aeb5712923;p=thirdparty%2Fsystemd.git repart: Correctly handle btrfs compression (#39597) systemd-repart is incorrectly choosing the loop-mount code path to copy files after formatting, instead of using the --rootdir path, which is required by mkfs.btrfs to apply compression (since it's on files, not the fs). So two fixes (and an integ test): 1. If Btrfs compression is requested without a root directory (e.g., Compression= without CopyFiles=), we now log a warning and skip the --compress flag. This prevents the mkfs.btrfs failure, and it's meaningless anyway without any files. 2. The logic in repart now uses the --rootdir code path whenever the partition is btrfs and compression is requested. Otherwise it still won't work even in the legitimate case because use the loop mounting code, which is too late to use --compress. Fixes: https://github.com/systemd/systemd/issues/39584 --- 445b7073c7b6ddac9d033ff9cb83c6aeb5712923