]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: (vfat) add more debug messages
authorKarel Zak <kzak@redhat.com>
Fri, 9 Jun 2017 09:11:38 +0000 (11:11 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 9 Jun 2017 09:11:38 +0000 (11:11 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/superblocks/vfat.c

index a8186358be15478a64e79a701313434dbc813570..0cdd2bac7bb43da5ef129615bbe6b658795fc8ac 100644 (file)
@@ -197,8 +197,10 @@ static int fat_valid_superblock(blkid_probe pr,
                 * FAT-like pseudo-header.
                 */
                if ((memcmp(ms->ms_magic, "JFS     ", 8) == 0) ||
-                   (memcmp(ms->ms_magic, "HPFS    ", 8) == 0))
+                   (memcmp(ms->ms_magic, "HPFS    ", 8) == 0)) {
+                       DBG(LOWPROBE, ul_debug("\tJFS/HPFS detected"));
                        return 0;
+               }
        }
 
        /* fat counts(Linux kernel expects at least 1 FAT table) */
@@ -252,11 +254,15 @@ static int fat_valid_superblock(blkid_probe pr,
                 * etc..) before MBR. Let's make sure that there is no MBR with
                 * usable partition. */
                unsigned char *buf = (unsigned char *) ms;
+
                if (mbr_is_valid_magic(buf)) {
                        struct dos_partition *p0 = mbr_get_partition(buf, 0);
+
                        if (dos_partition_get_size(p0) != 0 &&
-                           (p0->boot_ind == 0 || p0->boot_ind == 0x80))
+                           (p0->boot_ind == 0 || p0->boot_ind == 0x80)) {
+                               DBG(LOWPROBE, ul_debug("\tMBR detected"));
                                return 0;
+                       }
                }
        }