From 043ec583dc65083203281112bd7dce8abfa93e94 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Thu, 21 Feb 2008 03:19:46 +0000 Subject: [PATCH] Don't check the bpbSecPerTrack and bpbHeads fields of the BPB. They are typically 0 on new ia64 systems. Since we don't use either field, there's no harm in not checking. --- sys/fs/msdosfs/msdosfs_vfsops.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index 6834381a6be..9bba037ec8f 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -508,14 +508,13 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp, struct thread *td) /* calculate the ratio of sector size to DEV_BSIZE */ pmp->pm_BlkPerSec = pmp->pm_BytesPerSec / DEV_BSIZE; - /* XXX - We should probably check more values here */ - if (!pmp->pm_BytesPerSec || !SecPerClust - || !pmp->pm_Heads -#ifdef PC98 - || !pmp->pm_SecPerTrack || pmp->pm_SecPerTrack > 255) { -#else - || !pmp->pm_SecPerTrack || pmp->pm_SecPerTrack > 63) { -#endif + /* + * We don't check pm_Heads nor pm_SecPerTrack, because + * these may not be set for EFI file systems. We don't + * use these anyway, so we're unaffected if they are + * invalid. + */ + if (!pmp->pm_BytesPerSec || !SecPerClust) { error = EINVAL; goto error_exit; }