From owner-freebsd-fs@FreeBSD.ORG Sun Jul 1 22:21:25 2007 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E0E4B16A400 for ; Sun, 1 Jul 2007 22:21:25 +0000 (UTC) (envelope-from soc@hbar.us) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.172]) by mx1.freebsd.org (Postfix) with ESMTP id 81B1913C489 for ; Sun, 1 Jul 2007 22:21:25 +0000 (UTC) (envelope-from soc@hbar.us) Received: by ug-out-1314.google.com with SMTP id o4so773118uge for ; Sun, 01 Jul 2007 15:21:24 -0700 (PDT) Received: by 10.78.180.16 with SMTP id c16mr2658034huf.1183326898799; Sun, 01 Jul 2007 14:54:58 -0700 (PDT) Received: by 10.78.138.5 with HTTP; Sun, 1 Jul 2007 14:54:58 -0700 (PDT) Message-ID: <47a4f3080707011454m6e06c97bu4764b32a65160ad6@mail.gmail.com> Date: Sun, 1 Jul 2007 17:54:58 -0400 From: "Brian Chu" To: Raaf , "Kostik Belousov" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4687FF75.3000108@zen.mooo.com> Cc: freebsd-fs@freebsd.org, Dennis Melentyev , freebsd-stable@freebsd.org Subject: Re: Cannot mount Sony Ericsson mobile phone, msdosfs too restrictive? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2007 22:21:26 -0000 Raaf, 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? Brian On 7/1/07, Dennis Melentyev 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 : > > 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 > > > > > > _______________________________________________ > > freebsd-stable@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" > > > > > -- > Dennis Melentyev > _______________________________________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" >