From: Lennart Poettering Date: Thu, 7 Apr 2022 12:11:44 +0000 (+0200) Subject: dissect: improve debug logging in probe_filesystem() X-Git-Tag: v251-rc2~165^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1cefb9a6af1a4e87d7602886fc425aa9637020b4;p=thirdparty%2Fsystemd.git dissect: improve debug logging in probe_filesystem() --- diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 6e287ecac72..2cf031cdeb0 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -92,21 +92,21 @@ int probe_filesystem(const char *node, char **ret_fstype) { errno = 0; r = blkid_do_safeprobe(b); - if (r == 1) { - log_debug("No type detected on partition %s", node); + if (r == 1) goto not_found; - } if (r == -2) return log_debug_errno(SYNTHETIC_ERRNO(EUCLEAN), "Results ambiguous for partition %s", node); if (r != 0) - return errno_or_else(EIO); + return log_debug_errno(errno_or_else(EIO), "Failed to probe partition %s: %m", node); (void) blkid_probe_lookup_value(b, "TYPE", &fstype, NULL); if (fstype) { char *t; + log_debug("Probed fstype '%s' on partition %s.", fstype, node); + t = strdup(fstype); if (!t) return -ENOMEM; @@ -116,6 +116,7 @@ int probe_filesystem(const char *node, char **ret_fstype) { } not_found: + log_debug("No type detected on partition %s", node); *ret_fstype = NULL; return 0; #else