[PATCH] blkid: Remove test for non-zero head count in FAT superblock probe.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <Nick.Holloway@xxxxxxxxxxxxxx>
---
This patch enables the VTech Kidizoom camera to be detected correctly
and auto-mounted by removing the requirement that a FAT superblock has
a non-zero number of heads.

The test image was created by zeroing out internal storage, and then
using the camera to format it.

Ubuntu has bug 500398 (https://bugs.launchpad.net/bugs/500398) for
this problem.

 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 29c4da2..782bc14 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 0000000..ba47078
--- /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
zcmV-W0k8f-T4*^jL0KkKS?*Zak_CQg|9}5rL;ye`WrU|^&wvU*Ktf0W01zMmU;uCc
z00;m`umJc-Xrm~^$?2e;rc8|ipwmqlOk+bsKn6oV00004Q4vGRJw}X%hJXz;8Z<Vg
zX<IG)rE6xOy}ALEcBz&XQs`}|DxgFNf}8~<1XM*t-xWEb1XNW-z64Q4R7k@uJ-F|@
z0-`D+swNO3Nex0IaDs^kyp7nI9qL3yXiH{tN|GXBfB>SNfKCW|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%kz<N>u

literal 0
HcmV?d00001

-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux