From: Karel Zak Date: Fri, 9 Jun 2017 09:11:38 +0000 (+0200) Subject: libblkid: (vfat) add more debug messages X-Git-Tag: v2.31-rc1~329 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bff78d701d73dcd77d1631433d0d377917c2bfba;p=thirdparty%2Futil-linux.git libblkid: (vfat) add more debug messages Signed-off-by: Karel Zak --- diff --git a/libblkid/src/superblocks/vfat.c b/libblkid/src/superblocks/vfat.c index a8186358be..0cdd2bac7b 100644 --- a/libblkid/src/superblocks/vfat.c +++ b/libblkid/src/superblocks/vfat.c @@ -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; + } } }