From owner-cvs-all Fri Aug 25 2: 4: 3 2000 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id BA87137B423; Fri, 25 Aug 2000 02:03:59 -0700 (PDT) Received: (from bde@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id CAA28823; Fri, 25 Aug 2000 02:03:59 -0700 (PDT) (envelope-from bde@FreeBSD.org) Message-Id: <200008250903.CAA28823@freefall.freebsd.org> From: Bruce Evans Date: Fri, 25 Aug 2000 02:03:59 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/msdosfs bpb.h msdosfsmount.h X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG bde 2000/08/25 02:03:59 PDT Modified files: sys/msdosfs bpb.h msdosfsmount.h Log: Quick fix for msdsofs_write() on alphas and other machines with either longs larger than 32 bits or strict alignment requirements. pm_fatmask had type u_long, but it must have a type that has precisely 32 bits and this type must be no smaller than int, so that ~pmp->pm_fatmask has no bits above the 31st set. Otherwise, comparisons between (cn | ~pmp->pm_fatmask) and magic 32-bit "cluster" numbers always fail. The correct fix is to use the C99 type uint_least32_t and mask with 0xffffffff. The quick fix is to use u_int32_t and assume that ints have msdosfs metadata is riddled with unaligned fields, and on alphas, unaligned_fixup() apparently has problems fixing up the unaligned accesses caused by this. The quick fix is to not comment out the NetBSD code that sort of handles this, and define UNALIGNED_ACCESS on i386's so that the code doesn't change on i386's. The correct fix would define UNALIGNED_ACCESS in a central machine-dependent header and maybe add some extra cases to unaligned_fixup(). UNALIGNED_ACCESS is also tested in isofs. Submitted by: parts by Mark Abene PR: 19086 Revision Changes Path 1.8 +8 -2 src/sys/msdosfs/bpb.h 1.22 +2 -2 src/sys/msdosfs/msdosfsmount.h To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message