summaryrefslogtreecommitdiff
path: root/extras/volume_id/lib
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2007-10-17 17:59:27 +0200
committerKay Sievers <kay.sievers@vrfy.org>2007-10-17 17:59:27 +0200
commit424520043aa0ea509399ca8c86fea2c79ddc91ee (patch)
tree8975e11054dd2c1febe6533d4b3b09316ffbe774 /extras/volume_id/lib
parent6e9edde6c962ab183e8d86086bddda7aa6e3cb9b (diff)
volume_id: vfat - allow all possible sector sizes
https://bugs.launchpad.net/bugs/147807
Diffstat (limited to 'extras/volume_id/lib')
-rw-r--r--extras/volume_id/lib/fat.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/extras/volume_id/lib/fat.c b/extras/volume_id/lib/fat.c
index 54e6bab7d2..3ddf0258eb 100644
--- a/extras/volume_id/lib/fat.c
+++ b/extras/volume_id/lib/fat.c
@@ -310,7 +310,7 @@ magic:
if (!vs->reserved)
return -1;
- /* fat count*/
+ /* fat count */
if (!vs->fats)
return -1;
@@ -318,15 +318,14 @@ magic:
if (vs->media < 0xf8 && vs->media != 0xf0)
return -1;
- /* cluster size check*/
+ /* cluster size check */
if (vs->sectors_per_cluster == 0 ||
(vs->sectors_per_cluster & (vs->sectors_per_cluster-1)))
return -1;
/* sector size check */
sector_size = le16_to_cpu(vs->sector_size);
- if (sector_size != 0x200 && sector_size != 0x400 &&
- sector_size != 0x800 && sector_size != 0x1000)
+ if (sector_size == 0 || ((sector_size & (sector_size-1)) != 0))
return -1;
dbg("sector_size 0x%x", sector_size);