FAT: handle the cluster number being 1
authorH. Peter Anvin <hpa@zytor.com>
Mon, 25 Jan 2010 17:28:26 +0000 (09:28 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 25 Jan 2010 17:28:26 +0000 (09:28 -0800)
Any reference to cluster 1 is an error, so treat it the same as
cluster 0 or one of the EOF cluster numbers.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
core/fs/fat/fat.c

index ce3cae6..21dda90 100644 (file)
@@ -128,7 +128,7 @@ static sector_t get_next_sector(struct fs_info* fs, uint32_t sector)
     
     /* get a new cluster */
     cluster = get_next_cluster(fs, (data_sector >> FAT_SB(fs)->clust_shift) + 2);
-    if (!cluster 
+    if (cluster < 2
        return 0;
     
     /* return the start of the new cluster */