msdosfs for an iriver x20

Kostik Belousov kostikbel at gmail.com
Thu Aug 14 11:00:13 UTC 2008


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.
> 
> The msdos file system routines detect:
>     pmp->pm_SecPerTrack=64 (0x40)
> 
> 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?
> 
> Tim.
> 
> --- sys/fs/msdosfs/msdosfs_vfsops.c.orig	2008-08-14 09:43:06.000000000 +1000
> +++ 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 = EINVAL;
>  		goto error_exit;
> 

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 at 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.
    
    
    git-svn-id: file:///usr/local/arch/freebsd/svn/base/head@176431 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.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, struct thread *td)
 	/* calculate the ratio of sector size to DEV_BSIZE */
 	pmp->pm_BlkPerSec = pmp->pm_BytesPerSec / DEV_BSIZE;
 
-	/* 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 = EINVAL;
 		goto error_exit;
 	}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20080814/68840c43/attachment.pgp


More information about the freebsd-fs mailing list