From 70cc3326407a90c621f7472098f0dbee32b9629c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 16 Jul 2026 13:45:23 +0200 Subject: [PATCH] repart: log allocation failure at debug level in Varlink service mode When systemd-sysinstall probes whether an installation would fit by calling io.systemd.Repart.Run() in dry-run mode, systemd-repart runs as a child process sharing sysinstall's stderr. When the requested partitions didn't fit, context_ponder() logged its failure at LOG_ERR before vl_method_run() converted it into a structured Varlink error (InsufficientFreeSpace or DiskTooSmall), which the client then reports to the user in its own words. The internal message hence appeared interleaved with the user-facing report: Can't fit requested partitions into available free space (1.9G), refusing. The selected disk is not large enough for an OS installation. The size of the selected disk is 0B, but a minimal size of 15.7G is required. Log at LOG_DEBUG when running as a Varlink service, and keep LOG_ERR for CLI invocations, where this message is the primary error report shown to the user. --- src/repart/repart.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/repart/repart.c b/src/repart/repart.c index fdca12a847..7a6c542c69 100644 --- a/src/repart/repart.c +++ b/src/repart/repart.c @@ -11402,10 +11402,13 @@ static int context_ponder(Context *context) { if (context_drop_or_foreignize_one_priority(context)) continue; /* Still no luck. Let's drop a priority and try again. */ - /* No more priorities left to drop. This configuration just doesn't fit on this disk... */ - return log_error_errno(SYNTHETIC_ERRNO(ENOSPC), - "Can't fit requested partitions into available free space (%s), refusing.", - FORMAT_BYTES(largest_free_area)); + /* No more priorities left to drop. This configuration just doesn't fit on this disk... + * In Varlink service mode the failure is reported to the client as a structured error, + * hence only log at debug level here. */ + return log_full_errno(arg_varlink ? LOG_DEBUG : LOG_ERR, + SYNTHETIC_ERRNO(ENOSPC), + "Can't fit requested partitions into available free space (%s), refusing.", + FORMAT_BYTES(largest_free_area)); } LIST_FOREACH(partitions, p, context->partitions) {