#1363 closed defect (fixed)

32 bit values not written correctly in FAT f/s data

Reported by: Gene Smith Owned by: Chris Johns
Priority: normal Milestone: 4.10
Component: fs/fat Version: 4.9
Severity: normal Keywords:
Cc: joel.sherrill@…, chrisj@… Blocked By:


In cpukit/libfs/src/dosfs/fat.h the macro FAT_SET_VAL32 (line 126) has an incorrect "&&" when just "&" is intended it seems. This results in an incorrect encoding in the f/s of 32-bit values such as "number of sectors in the filesystem." For my disk the correct value was 0x0001B708 (correctly read from the MBR sector 0) but the encoded value was 0x10001 (put in FAT boot record sector 63 when formatted). This resulted in the disk appearing 1/2 full in linux gparted when it only contained a single small file copied to it in rtems. Also, linux df showed an incorrect number of 1k blocks available. Note: my "disk" is an MMC card formatted to FAT16.

Attachments (1)

fat.h.patch (440 bytes) - added by Gene Smith on Jan 29, 2009 at 3:03:28 PM.
Patch to resolve problem

Download all attachments as: .zip

Change History (5)

comment:1 Changed on Jan 28, 2009 at 11:15:40 PM by Chris Johns

Cc: Chris Johns added
Owner: changed from Joel Sherrill to Chris Johns

comment:2 Changed on Jan 29, 2009 at 2:04:55 PM by Joel Sherrill

Cc: Joel Sherrill added

Changed on Jan 29, 2009 at 3:03:28 PM by Gene Smith

Attachment: fat.h.patch added

Patch to resolve problem

comment:3 Changed on Jan 29, 2009 at 3:15:21 PM by Joel Sherrill

Resolution: fixed
Status: newclosed

Patch applied to all active branches and CVS head. Thanks.

comment:4 Changed on Oct 10, 2017 at 6:50:58 AM by Sebastian Huber

Component: fsfs/fat
Note: See TracTickets for help on using tickets.