From e0565b5794c9fb041922ccea2d6e78b8d943be8a Mon Sep 17 00:00:00 2001 From: peadar Date: Thu, 29 Sep 2005 14:09:46 +0000 Subject: [PATCH] Remove checks for BOOTSIG[23] from FAT32 bootblocks. There seems to be very little documentary evidence outside this implementation to suggest a these checks are neccessary, and more than one camera-formatted flash disk fails the check, but mounts successfully on most other systems. Reviewed By: bde@ --- sys/fs/msdosfs/bootsect.h | 6 +----- sys/fs/msdosfs/msdosfs_vfsops.c | 4 +--- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/fs/msdosfs/bootsect.h b/sys/fs/msdosfs/bootsect.h index 3102ce3f0b34..9e8aa9767b90 100644 --- a/sys/fs/msdosfs/bootsect.h +++ b/sys/fs/msdosfs/bootsect.h @@ -61,15 +61,11 @@ struct bootsector710 { int8_t bsOEMName[8]; /* OEM name and version */ int8_t bsBPB[53]; /* BIOS parameter block */ int8_t bsExt[26]; /* Bootsector Extension */ - int8_t bsBootCode[418]; /* pad so structure is 512b */ - u_int8_t bsBootSectSig2; /* 2 & 3 are only defined for FAT32? */ - u_int8_t bsBootSectSig3; + int8_t bsBootCode[420]; /* pad so structure is 512b */ u_int8_t bsBootSectSig0; u_int8_t bsBootSectSig1; #define BOOTSIG0 0x55 #define BOOTSIG1 0xaa -#define BOOTSIG2 0 -#define BOOTSIG3 0 }; union bootsector { diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index 037d9b4d52b3..bc59b44fd53a 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -510,9 +510,7 @@ mountmsdosfs(devvp, mp, td) #endif /* !MSDOSFS_LARGE */ if (pmp->pm_RootDirEnts == 0) { - if (bsp->bs710.bsBootSectSig2 != BOOTSIG2 - || bsp->bs710.bsBootSectSig3 != BOOTSIG3 - || pmp->pm_Sectors + if (pmp->pm_Sectors || pmp->pm_FATsecs || getushort(b710->bpbFSVers)) { error = EINVAL;