From owner-freebsd-fs@FreeBSD.ORG Thu Aug 14 11:00:13 2008 Return-Path: Delivered-To: fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14D32106568B for ; Thu, 14 Aug 2008 11:00:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id AB5348FC13 for ; Thu, 14 Aug 2008 11:00:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtp (Exim 4.63 (FreeBSD)) (envelope-from ) id 1KTaML-0005Wd-Ln; Thu, 14 Aug 2008 13:47:13 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m7EAlAVf029360 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 14 Aug 2008 13:47:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m7EAlA3D077386; Thu, 14 Aug 2008 13:47:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m7EAl9CE077382; Thu, 14 Aug 2008 13:47:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 14 Aug 2008 13:47:09 +0300 From: Kostik Belousov To: Timothy Bourke Message-ID: <20080814104709.GL1803@deviant.kiev.zoral.com.ua> References: <20080814005210.GB1057@triptrop.cse.unsw.EDU.AU> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qo7zVO9a9OQ5oQtr" Content-Disposition: inline In-Reply-To: <20080814005210.GB1057@triptrop.cse.unsw.EDU.AU> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1KTaML-0005Wd-Ln 395e78678a5ba8c5e1f0b517e4a05c52 X-Terabit: YES Cc: fs@freebsd.org Subject: Re: msdosfs for an iriver x20 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: Thu, 14 Aug 2008 11:00:13 -0000 --qo7zVO9a9OQ5oQtr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 14, 2008 at 10:52:10AM +1000, Timothy Bourke wrote: > The iriver x20 portable media player in MSC mode is detected by the > umass driver but the internal flash memory cannot be mounted (7.6GB > FAT32 filesystem on an unsliced disk) under 6.3-RELEASE. >=20 > The msdos file system routines detect: > pmp->pm_SecPerTrack=3D64 (0x40) >=20 > The patch below fixes the problem. It looks like HEAD contains more > general improvements that should also work but RELENG_6 does not. > Would it be worth MFCing the new changes or committing the attached > patch before the 6.4 release? >=20 > Tim. >=20 > --- sys/fs/msdosfs/msdosfs_vfsops.c.orig 2008-08-14 09:43:06.000000000 +1= 000 > +++ sys/fs/msdosfs/msdosfs_vfsops.c 2008-08-14 09:43:19.000000000 +1000 > @@ -504,7 +504,7 @@ > #ifdef PC98 > || !pmp->pm_SecPerTrack || pmp->pm_SecPerTrack > 255) { > #else > - || !pmp->pm_SecPerTrack || pmp->pm_SecPerTrack > 63) { > + || !pmp->pm_SecPerTrack || pmp->pm_SecPerTrack > 64) { > #endif > error =3D EINVAL; > goto error_exit; >=20 So, could you, please, confirm that the change below works correctly for you on RELENG_6 ? After your confirmation I will commit it into RELENG_6. I merged it to RELENG_7 exactly to be able to use iriver clix2. commit 89d237ece000e6ccf208553e95c72efdf217e792 Author: marcel Date: Thu Feb 21 03:19:46 2008 +0000 Don't check the bpbSecPerTrack and bpbHeads fields of the BPB. They are typically 0 on new ia64 systems. Since we don't use either field, there's no harm in not checking. =20 =20 git-svn-id: file:///usr/local/arch/freebsd/svn/base/head@176431 ccf9f87= 2-aa2e-dd11-9fc8-001c23d0bc1f diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsop= s.c index 6834381..9bba037 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -508,14 +508,13 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp, s= truct thread *td) /* calculate the ratio of sector size to DEV_BSIZE */ pmp->pm_BlkPerSec =3D pmp->pm_BytesPerSec / DEV_BSIZE; =20 - /* 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 - || !pmp->pm_SecPerTrack || pmp->pm_SecPerTrack > 63) { -#endif + /* + * 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 =3D EINVAL; goto error_exit; } --qo7zVO9a9OQ5oQtr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkikDS0ACgkQC3+MBN1Mb4gQKQCeO0XBQsiTmoz0CUrclznh9EEH 1bcAoI3pjje+i6rkHfkKeHfkRJbtRAyW =nnuM -----END PGP SIGNATURE----- --qo7zVO9a9OQ5oQtr--