Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jun 2000 14:10:02 -0700 (PDT)
From:      Mark Abene <phiber@radicalmedia.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: misc/19086: pseudo-device vn doesn't work properly with msdos filesystems
Message-ID:  <200006082110.OAA20673@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR misc/19086; it has been noted by GNATS.

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
Date: Thu, 8 Jun 2000 16:47:02 -0400

 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-bugs" in the body of the message




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