From: Nick Holloway Date: Sun, 10 Apr 2011 12:35:56 +0000 (+0100) Subject: libblkid: remove test for non-zero head count in FAT superblock probe. X-Git-Tag: v2.20-rc1~350 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=20f5be46ec57af3f21913c487000d69fb8857e18;p=thirdparty%2Futil-linux.git libblkid: remove test for non-zero head count in FAT superblock probe. This change enables the auto-detection of the internal storage on a VTech Kidizoom camera, which has a zero head count value in the superblock. Microsoft documentation, "FAT: General Overview of On-Disk Format", states that the sectors and heads fields are only relevant for media that have a geometry. The Linux kernel also does not require a non-zero head count, and can manually mount the filesystem. Signed-off-by: Nick Holloway --- diff --git a/shlibs/blkid/src/superblocks/vfat.c b/shlibs/blkid/src/superblocks/vfat.c index 29c4da2a18..782bc143be 100644 --- a/shlibs/blkid/src/superblocks/vfat.c +++ b/shlibs/blkid/src/superblocks/vfat.c @@ -186,8 +186,6 @@ static int fat_valid_superblock(const struct blkid_idmag *mag, if (ms->ms_pmagic[0] != 0x55 || ms->ms_pmagic[1] != 0xAA) return 0; - if (ms->ms_heads == 0) - return 0; /* * OS/2 and apparently DFSee will place a FAT12/16-like * pseudo-superblock in the first 512 bytes of non-FAT diff --git a/tests/expected/blkid/low-probe-fat16_noheads b/tests/expected/blkid/low-probe-fat16_noheads new file mode 100644 index 0000000000..ba47078d24 --- /dev/null +++ b/tests/expected/blkid/low-probe-fat16_noheads @@ -0,0 +1,8 @@ +ID_FS_LABEL=VTech_1070 +ID_FS_LABEL_ENC=VTech\x201070 +ID_FS_SEC_TYPE=msdos +ID_FS_TYPE=vfat +ID_FS_USAGE=filesystem +ID_FS_UUID=2004-1014 +ID_FS_UUID_ENC=2004-1014 +ID_FS_VERSION=FAT16 diff --git a/tests/ts/blkid/images-fs/fat16_noheads.img.bz2 b/tests/ts/blkid/images-fs/fat16_noheads.img.bz2 new file mode 100644 index 0000000000..4d3d26c8cb Binary files /dev/null and b/tests/ts/blkid/images-fs/fat16_noheads.img.bz2 differ