]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dissect-image: generate better log message for EUCLEAN dissect error
authorLennart Poettering <lennart@poettering.net>
Fri, 18 Oct 2024 12:16:53 +0000 (14:16 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 13 Nov 2024 19:48:10 +0000 (19:48 +0000)
Fixes: #31799
(cherry picked from commit 2186334e00acba6e6c1a4564bce60474eecfbf16)

src/shared/dissect-image.c

index 9a3a4f3dc05f45db3891b662302899e6d52823d8..65a706dc8a023fc32ae617dac9df952bed2f0df9 100644 (file)
@@ -706,7 +706,9 @@ static int dissect_image(
          * Returns -ERFKILL if image doesn't match image policy
          * Returns -EBADR if verity data was provided externally for an image that has a GPT partition table (i.e. is not just a naked fs)
          * Returns -EPROTONOSUPPORT if DISSECT_IMAGE_ADD_PARTITION_DEVICES is set but the block device does not have partition logic enabled
-         * Returns -ENOMSG if we didn't find a single usable partition (and DISSECT_IMAGE_REFUSE_EMPTY is set) */
+         * Returns -ENOMSG if we didn't find a single usable partition (and DISSECT_IMAGE_REFUSE_EMPTY is set)
+         * Returns -EUCLEAN if some file system had an ambiguous file system superblock signature
+         */
 
         uint64_t diskseq = m->loop ? m->loop->diskseq : 0;
 
@@ -1662,6 +1664,9 @@ int dissect_log_error(int log_level, int r, const char *name, const VeritySettin
         case -ENOMSG:
                 return log_full_errno(log_level, r, "%s: No suitable partitions found.", name);
 
+        case -EUCLEAN:
+                return log_full_errno(log_level, r, "%s: Partition with ambiguous file system superblock signature found.", name);
+
         default:
                 return log_full_errno(log_level, r, "%s: Cannot dissect image: %m", name);
         }