From 20f5be46ec57af3f21913c487000d69fb8857e18 Mon Sep 17 00:00:00 2001 From: Nick Holloway Date: Sun, 10 Apr 2011 13:35:56 +0100 Subject: [PATCH] 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 --- shlibs/blkid/src/superblocks/vfat.c | 2 -- tests/expected/blkid/low-probe-fat16_noheads | 8 ++++++++ tests/ts/blkid/images-fs/fat16_noheads.img.bz2 | Bin 0 -> 336 bytes 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 tests/expected/blkid/low-probe-fat16_noheads create mode 100644 tests/ts/blkid/images-fs/fat16_noheads.img.bz2 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 0000000000000000000000000000000000000000..4d3d26c8cb0fd331d7659ee1dc6503d08f93b05e GIT binary patch literal 336 zc-jF_0k8f-T4*^jL0KkKS?*Zak_CQg|9}5rL;ye`WrU|^&wvU*Ktf0W01zMmU;uCc z00;m`umJc-Xrm~^$?2e;rc8|ipwmqlOk+bsKn6oV00004Q4vGRJw}X%hJXz;8ZSNfKCW|X^TM%@fTw;3b^iZ zR(V8OI|^&Bz)z+LEFT5WJ1fgcu5&#$+91BDV2mp$%jz&z8wd+P4YT_P^bR{GCNcn` zDx!Q1hxv*M$ugSAa8DNa3jA^a1^@s6K>z`S0%|f90WC;W1i6X|$ugSCvU{391X;d7 i1^@sA002P%0R<_b%xa|+hQL%(9xmjHaG@dQf2n%kzu literal 0 Hc-jL100001 -- 2.47.3