[rtems commit] dosfs: Fix FAT32 formatter

Sebastian Huber sebh at rtems.org
Tue Feb 28 08:56:32 UTC 2017


Module:    rtems
Branch:    4.11
Commit:    17f81ee3cb41764d34c2f09a2b92c40a41f78841
Changeset: http://git.rtems.org/rtems/commit/?id=17f81ee3cb41764d34c2f09a2b92c40a41f78841

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Feb 27 11:50:30 2017 +0100

dosfs: Fix FAT32 formatter

The second FAT entry contains a bit to indicate if the FAT32 filesystem
is not dirty and a bit to indicate if there was no IO error.  Set both
bits for a fresh filesystem.  This prevents a warning if mounted on
Windows.

Update #2913.

---

 cpukit/libfs/src/dosfs/msdos_format.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpukit/libfs/src/dosfs/msdos_format.c b/cpukit/libfs/src/dosfs/msdos_format.c
index a7d72c3..17e435d 100644
--- a/cpukit/libfs/src/dosfs/msdos_format.c
+++ b/cpukit/libfs/src/dosfs/msdos_format.c
@@ -1204,8 +1204,8 @@ int msdos_format
     case FAT_FAT32:
       /* FAT entry 0: 0xffffff00|media_type */
       FAT_SET_VAL32(tmp_sec,0,0xffffff00|fmt_params.media_code);
-      /* FAT entry 1: EOC */
-      FAT_SET_VAL32(tmp_sec,4,FAT_FAT32_EOC);
+      /* FAT entry 1: Not dirty, no IO error, EOC */
+      FAT_SET_VAL32(tmp_sec,4,0xc0000000|FAT_FAT32_EOC);
       break;
 
     default:



More information about the vc mailing list