]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: remove test for non-zero head count in FAT superblock probe.
authorNick Holloway <Nick.Holloway@pyrites.org.uk>
Sun, 10 Apr 2011 12:35:56 +0000 (13:35 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 12 Apr 2011 12:38:53 +0000 (14:38 +0200)
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@pyrites.org.uk>
shlibs/blkid/src/superblocks/vfat.c
tests/expected/blkid/low-probe-fat16_noheads [new file with mode: 0644]
tests/ts/blkid/images-fs/fat16_noheads.img.bz2 [new file with mode: 0644]

index 29c4da2a18e101b30fe42ff85bad2329c053e5eb..782bc143be2d8ad3bd1ff5aefd76212f801e8f96 100644 (file)
@@ -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 (file)
index 0000000..ba47078
--- /dev/null
@@ -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 (file)
index 0000000..4d3d26c
Binary files /dev/null and b/tests/ts/blkid/images-fs/fat16_noheads.img.bz2 differ