From owner-freebsd-fs@FreeBSD.ORG Sun Jul 1 20:33:39 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 4B24516A468 for ; Sun, 1 Jul 2007 20:33:39 +0000 (UTC) (envelope-from dennis.melentyev@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.181]) by mx1.freebsd.org (Postfix) with ESMTP id 25FDC13C4BF for ; Sun, 1 Jul 2007 20:33:39 +0000 (UTC) (envelope-from dennis.melentyev@gmail.com) Received: by wa-out-1112.google.com with SMTP id j37so2035261waf for ; Sun, 01 Jul 2007 13:33:39 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=pa42MFIQvTpt1gGtJS99CT0c+E+Qi/xTJirXaKUiBTUelm5NZtB87ppOM8ChN+Fv1V3gUaYm8kWmDLTDN4JSMXKB/QXZkb9Pwf7F9HYCcHLfFtJCZUzwNpyXzrZWvc1pHHHDHW4r4c7uW2U83VVAk10ZBDVG4HTb5WIC4lFLWKs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=U30M+bjG8lk+3wbFR7TI9QwsY4mVZ71F2C3ikXewnkanz4D1xLOQHAxZc8VYGKu3NeDJnLoP1S20yAi4dFvBKj+C7+npkzY11uwVXkyaYbHh/jfAtsrbW9DyW62vpWc9XlkcoLt2rBrKxv2u2uV2RzwIlJvHPH+xaL4iQKEXx5g= Received: by 10.114.192.1 with SMTP id p1mr4492453waf.1183320307012; Sun, 01 Jul 2007 13:05:07 -0700 (PDT) Received: by 10.115.78.2 with HTTP; Sun, 1 Jul 2007 13:05:06 -0700 (PDT) Message-ID: Date: Sun, 1 Jul 2007 23:05:06 +0300 From: "Dennis Melentyev" To: Raaf In-Reply-To: <4687FF75.3000108@zen.mooo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4687FF75.3000108@zen.mooo.com> Cc: freebsd-fs@freebsd.org, 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 20:33:39 -0000 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