Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 01 Jul 2007 21:24:37 +0200
From:      Raaf <raaf@zen.mooo.com>
To:        freebsd-stable@freebsd.org, freebsd-fs@freebsd.org
Subject:   Cannot mount  Sony Ericsson mobile phone, msdosfs too restrictive?
Message-ID:  <4687FF75.3000108@zen.mooo.com>

next in thread | raw e-mail | index | archive | help
Hi, i got a Sony Ericsson mobile phone that came with a pre-formatted
memory stick that i'm unable to mount in FreeBSD (it mounts fine in
Linux).

After investigating i found out that the FreeBSD msdsofs driver bails
out on the following code (the pmp->pm_Heads being zero):

----------------------------------
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
                error = EINVAL;
                goto error_exit;
        }
----------------------------------

Removing the check for pmp->pm_Heads fixes it for me.

Is the check for pmp->pm_Heads really necessary?

Grepping through the msdosfs sources i can only see it being used for
validation and not used in any calculation (the same applies for the
pmp->pm_SecPerTrack value)


--- sys/fs/msdosfs/msdosfs_vfsops.c.orig        Sun Jul  1 20:42:14 2007
+++ sys/fs/msdosfs/msdosfs_vfsops.c     Sun Jul  1 20:46:57 2007
@@ -483,7 +483,6 @@

        /* 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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4687FF75.3000108>