]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dissect: improve debug logging in probe_filesystem() 23008/head
authorLennart Poettering <lennart@poettering.net>
Thu, 7 Apr 2022 12:11:44 +0000 (14:11 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 7 Apr 2022 16:56:38 +0000 (18:56 +0200)
src/shared/dissect-image.c

index 6e287ecac72a2714d56045b2b4420478976e704f..2cf031cdeb0aad60038ecf14861221c7fd4d3897 100644 (file)
@@ -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