From owner-freebsd-bugs Thu Jun 8 14:10: 5 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 9DED937BCE0 for ; Thu, 8 Jun 2000 14:10:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id OAA20673; Thu, 8 Jun 2000 14:10:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Thu, 8 Jun 2000 14:10:02 -0700 (PDT) Message-Id: <200006082110.OAA20673@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Mark Abene Subject: Re: misc/19086: pseudo-device vn doesn't work properly with msdos filesystems Reply-To: Mark Abene Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR misc/19086; it has been noted by GNATS. 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 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 -#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