Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jun 2000 16:47:02 -0400
From:      Mark Abene <phiber@radicalmedia.com>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        freebsd-gnats-submit@FreeBSD.ORG, freebsd-alpha@FreeBSD.ORG
Subject:   Re: misc/19086: pseudo-device vn doesn't work properly with msdos filesystems
Message-ID:  <20000608164702.A25023@radicalmedia.com>
In-Reply-To: <Pine.BSF.4.21.0006082353570.700-100000@besplex.bde.org>; from Bruce Evans on Fri, Jun 09, 2000 at 12:06:35AM %2B1000
References:  <20000608062159.A17655@radicalmedia.com> <Pine.BSF.4.21.0006082353570.700-100000@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jun 09, 2000 at 12:06:35AM +1000, Bruce Evans wrote:
> msdosfs metadata is riddled with unaligned fields in Intel (little endian)
> order.  naligned_fixup() apparently has problems fixing up the unaligned
> accesses related to this.  Try changing getushort(), etc., in msdosfs to
> do byte accesses even in the little endian case.  These macros currently
> only do byte access to fix up the byte order in the big endian case.  It
> should use something like ntohs() for that and be more careful about
> unaligned accesses.
> 
> Bruce
> 

That did the trick!  It's now working nicely.  Please accept the following
interim patch against 4.0-RELEASE, and thanks for the assistance!

**cut here**
--- msdosfs.orig/bpb.h	Fri Aug 27 20:48:07 1999
+++ msdosfs/bpb.h	Thu Jun  8 16:25:15 2000
@@ -114,7 +114,7 @@
  * use the macros for the big-endian case.
  */
 #include <machine/endian.h>
-#if (BYTE_ORDER == LITTLE_ENDIAN) 			/* && defined(UNALIGNED_ACCESS) */
+#if (BYTE_ORDER == LITTLE_ENDIAN) && !defined(__alpha__)	/* && defined(UNALIGNED_ACCESS) */
 #define	getushort(x)	*((u_int16_t *)(x))
 #define	getulong(x)	*((u_int32_t *)(x))
 #define	putushort(p, v)	(*((u_int16_t *)(p)) = (v))
--- msdosfs.orig/msdosfsmount.h	Thu Jan 27 09:43:07 2000
+++ msdosfs/msdosfsmount.h	Thu Jun  8 16:14:18 2000
@@ -84,7 +84,7 @@
 	u_long pm_fatblocksize;	/* size of fat blocks in bytes */
 	u_long pm_fatblocksec;	/* size of fat blocks in sectors */
 	u_long pm_fatsize;	/* size of fat in bytes */
-	u_long pm_fatmask;	/* mask to use for fat numbers */
+	u_int32_t pm_fatmask;	/* mask to use for fat numbers */
 	u_long pm_fsinfo;	/* fsinfo block number */
 	u_long pm_nxtfree;	/* next free cluster in fsinfo block */
 	u_int pm_fatmult;	/* these 2 values are used in fat */
**cut here**

Cheers,
-Mark



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000608164702.A25023>