From da8fa6e0c53465bc3431fe56f68e24c72ee433d9 Mon Sep 17 00:00:00 2001 From: Hasso Tepper Date: Sat, 3 Jan 2009 00:05:03 +0200 Subject: [PATCH] Don't check pm_Heads nor pm_SecPerTrack. These might be 0 and aren't used anyway. Makes some "god knows where formatted" usb sticks work here. Obtained-from: FreeBSD --- sys/vfs/msdosfs/msdosfs_vfsops.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/vfs/msdosfs/msdosfs_vfsops.c b/sys/vfs/msdosfs/msdosfs_vfsops.c index 1cda067848..e8b4afa6ac 100644 --- a/sys/vfs/msdosfs/msdosfs_vfsops.c +++ b/sys/vfs/msdosfs/msdosfs_vfsops.c @@ -394,10 +394,13 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp, struct msdosfs_args *argp) #ifndef __DragonFly__ if (!(argp->flags & MSDOSFSMNT_GEMDOSFS)) { #endif - /* XXX - We should probably check more values here */ - if (!pmp->pm_BytesPerSec || !SecPerClust - || !pmp->pm_Heads - || !pmp->pm_SecPerTrack || pmp->pm_SecPerTrack > 63) { + /* + * 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; } -- 2.11.4.GIT