From 8ce4e5c2c02cb7e8adddf7b651d3050d81ce4c1d Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 2 Mar 2008 23:33:46 +0100 Subject: Fix checking fat32 cluster size. This fixes the cluster size tests in the FAT32 file system. The current implementation of VFAT support doesn't work if the referred cluster has an offset > 16bit representation, causing "fatload" and "fatls" commands etc. to fail. Signed-off-by: michael trimarchi --- include/fat.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/fat.h') diff --git a/include/fat.h b/include/fat.h index 92638d535e..f993ccab1c 100644 --- a/include/fat.h +++ b/include/fat.h @@ -111,7 +111,8 @@ #define START(dent) (FAT2CPU16((dent)->start) \ + (mydata->fatsize != 32 ? 0 : \ (FAT2CPU16((dent)->starthi) << 16))) - +#define CHECK_CLUST(x, fatsize) ((x) <= 1 || \ + (x) >= ((fatsize) != 32 ? 0xfff0 : 0xffffff0)) typedef struct boot_sector { __u8 ignored[3]; /* Bootstrap code */ -- cgit v1.2.1