Don't check pm_Heads nor pm_SecPerTrack.
authorHasso Tepper <hasso@estpak.ee>
Fri, 2 Jan 2009 22:05:03 +0000 (00:05 +0200)
committerHasso Tepper <hasso@estpak.ee>
Tue, 20 Jan 2009 09:47:04 +0000 (11:47 +0200)
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

index 1cda067..e8b4afa 100644 (file)
@@ -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;
                }