From owner-freebsd-alpha Thu Jun 8 14: 0:29 2000 Delivered-To: freebsd-alpha@freebsd.org Received: from eel.radicalmedia.com (eel.radicalmedia.com [204.254.246.9]) by hub.freebsd.org (Postfix) with ESMTP id A2F6C37C280; Thu, 8 Jun 2000 14:00:23 -0700 (PDT) (envelope-from phiber@eel.radicalmedia.com) Received: (from phiber@localhost) by eel.radicalmedia.com (8.9.3/8.9.3) id QAA25276; Thu, 8 Jun 2000 16:47:02 -0400 (EDT) Date: Thu, 8 Jun 2000 16:47:02 -0400 From: Mark Abene To: Bruce Evans 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> References: <20000608062159.A17655@radicalmedia.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.1i In-Reply-To: ; from Bruce Evans on Fri, Jun 09, 2000 at 12:06:35AM +1000 Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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 -#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