bin/162486: [patch] Cannot mount filesystem formatted by newfs_msdos on ARM

Ian Lepore freebsd at damnhippie.dyndns.org
Fri Nov 11 17:50:06 UTC 2011


>Number:         162486
>Category:       bin
>Synopsis:       [patch] Cannot mount filesystem formatted by newfs_msdos on ARM
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 11 17:50:04 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Ian Lepore <freebsd at damnhippie.dyndns.org>
>Release:        FreeBSD 8.2-STABLE arm
>Organization:
Symmetricom, Inc.
>Environment:
FreeBSD tflex 8.2-STABLE FreeBSD 8.2-STABLE #29: Tue Oct 11 13:32:35 UTC 2011     root at revolution.hippie.lan:/usr/obj/arm/usr/src/sys/TFLEX  arm

>Description:
A filesystem formated with newfs_msdos on an ARM system cannot be mounted on
ARM or other architectures.  The problem turned out to be ARM ABI structure 
packing.  More information is available in this mail thread:

http://lists.freebsd.org/pipermail/freebsd-arm/2011-October/003106.html

>How-To-Repeat:

>Fix:

--- newfs_msdos.diff begins here ---
Index: sbin/newfs_msdos/newfs_msdos.c
===================================================================
RCS file: /local/base/FreeBSD-CVS/src/sbin/newfs_msdos/newfs_msdos.c,v
retrieving revision 1.37
diff -u -p -r1.37 newfs_msdos.c
--- sbin/newfs_msdos/newfs_msdos.c	12 Jul 2011 10:07:07 -0000	1.37
+++ sbin/newfs_msdos/newfs_msdos.c	11 Nov 2011 17:31:11 -0000
@@ -99,7 +99,7 @@ static const char rcsid[] =
 struct bs {
     u_int8_t bsJump[3];		/* bootstrap entry point */
     u_int8_t bsOemName[8];		/* OEM name and version */
-};
+} __packed;
 
 struct bsbpb {
     u_int8_t bpbBytesPerSec[2];		/* bytes per sector */
@@ -114,7 +114,7 @@ struct bsbpb {
     u_int8_t bpbHeads[2];		/* drive heads */
     u_int8_t bpbHiddenSecs[4];		/* hidden sectors */
     u_int8_t bpbHugeSectors[4];		/* big total sectors */
-};
+} __packed;
 
 struct bsxbpb {
     u_int8_t bpbBigFATsecs[4];		/* big sectors per FAT */
@@ -124,7 +124,7 @@ struct bsxbpb {
     u_int8_t bpbFSInfo[2];		/* file system info sector */
     u_int8_t bpbBackup[2];		/* backup boot sector */
     u_int8_t bpbReserved[12];			/* reserved */
-};
+} __packed;
 
 struct bsx {
     u_int8_t exDriveNumber;		/* drive number */
@@ -133,7 +133,7 @@ struct bsx {
     u_int8_t exVolumeID[4];		/* volume ID number */
     u_int8_t exVolumeLabel[11]; 	/* volume label */
     u_int8_t exFileSysType[8];		/* file system type */
-};
+} __packed;
 
 struct de {
     u_int8_t deName[11];	/* name and extension */
@@ -143,7 +143,7 @@ struct de {
     u_int8_t deMDate[2];	/* creation date */
     u_int8_t deStartCluster[2];	/* starting cluster */
     u_int8_t deFileSize[4];	/* size */
-};
+} __packed;
 
 struct bpb {
     u_int bpbBytesPerSec;		/* bytes per sector */
--- newfs_msdos.diff ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list