On Sun, 1 Jul 2007, Brian Chu wrote:

What's the size of the memory stick?  Is it 32MB like Dennis has?

The check for the field that affected you isn't critical to msdosfs' operation, but the field itself is specified to be non-zero. Konstantin, is it alright to remove this field?

It turns out that quite a bit of our historical sanity checking on msdosfs is too conservative when applied to the highly diverse set of FAT file systems in the field. I think it would be useful for someone(tm) to compare the sanity checks in our version of msdosfs and the checks in the Darwin version and see what they've had to remove.

Robert N M Watson
Computer Laboratory
University of Cambridge


Brian

On 7/1/07, Dennis Melentyev <[EMAIL PROTECTED]> wrote:
Well, had the same problem.
For me, it looks like SE is using FAT12 (!!!Not 16!!!) on a devive
larger than 32MB. Could have something slipped off my mind, but quite
close. It is a BROKEN msdosfs on a stick.

Just re-formated 1Gb flash with FAT32 using card reader and both K750i
and FreeBSD are happy.

2007/7/1, Raaf <[EMAIL PROTECTED]>:
> 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
>
>
> _______________________________________________
> [email protected] mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-stable
> To unsubscribe, send any mail to "[EMAIL PROTECTED]"
>


--
Dennis Melentyev
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-fs
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-fs
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to