Date: Thu, 14 Aug 2008 13:47:09 +0300 From: Kostik Belousov <kostikbel@gmail.com> To: Timothy Bourke <timbob@bigpond.com> Cc: fs@freebsd.org Subject: Re: msdosfs for an iriver x20 Message-ID: <20080814104709.GL1803@deviant.kiev.zoral.com.ua> In-Reply-To: <20080814005210.GB1057@triptrop.cse.unsw.EDU.AU> References: <20080814005210.GB1057@triptrop.cse.unsw.EDU.AU>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <marcel@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f> 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080814104709.GL1803>