Index: /trunk/src/VBox/Runtime/common/fs/fatvfs.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/fs/fatvfs.cpp	(revision 75626)
+++ /trunk/src/VBox/Runtime/common/fs/fatvfs.cpp	(revision 75627)
@@ -731,5 +731,5 @@
              */
             pPart = RTListGetFirst(&pChain->ListParts, RTFSFATCHAINPART, ListEntry);
-            while (idxPart-- > 1)
+            while (idxPart-- > 0)
                 pPart = RTListGetNext(&pChain->ListParts, pPart, RTFSFATCHAINPART, ListEntry);
         }
@@ -905,4 +905,5 @@
 {
     PRTFSFATCLUSTERMAPCACHE pFatCache = pThis->pFatCache;
+    Log3(("rtFsFatClusterMap_FlushWorker: %p %#x %#x\n", pThis, iFirstEntry, iLastEntry));
 
     /*
@@ -1226,4 +1227,7 @@
 
         /* Next cluster. */
+#ifdef LOG_ENABLED
+        const uint32_t idxPrevCluster = idxCluster;
+#endif
         bool     fOdd   = idxCluster & 1;
         uint32_t offFat = idxCluster * 3 / 2;
@@ -1233,4 +1237,5 @@
         else
             idxCluster &= 0x0fff;
+        Log4(("Fat/ReadChain12: [%#x] %#x (next: %#x)\n", pChain->cClusters - 1, idxPrevCluster, idxCluster));
     }
 }
@@ -1383,4 +1388,5 @@
     if (idxCluster & 1)
     {
+        Log3(("Fat/SetCluster12: [%#x]: %#x -> %#x\n", idxCluster, (((pbFat[offFat]) & 0xf0) >> 4) | ((unsigned)pbFat[offFat + 1] << 4), uValue));
         pbFat[offFat]     = ((uint8_t)0x0f & pbFat[offFat]) | ((uint8_t)uValue << 4);
         pbFat[offFat + 1] = (uint8_t)(uValue >> 4);
@@ -1388,4 +1394,5 @@
     else
     {
+        Log3(("Fat/SetCluster12: [%#x]: %#x -> %#x\n", idxCluster, pbFat[offFat] | ((pbFat[offFat + 1] & 0x0f) << 8), uValue));
         pbFat[offFat]     = (uint8_t)uValue;
         pbFat[offFat + 1] = ((uint8_t)0xf0 & pbFat[offFat + 1]) | (uint8_t)(uValue >> 8);
@@ -2299,4 +2306,5 @@
         }
     }
+    Log3(("rtFsFatObj_SetSize: Returns %Rrc\n", rc));
     return rc;
 }
@@ -2643,5 +2651,8 @@
                 if (   (fOpen & RTFILE_O_TRUNCATE)
                     || (fOpen & RTFILE_O_ACTION_MASK) == RTFILE_O_CREATE_REPLACE)
+                {
+                    Log3(("rtFsFatFile_New: calling rtFsFatObj_SetSize to zap the file size.\n"));
                     rc = rtFsFatObj_SetSize(&pShared->Core, 0);
+                }
                 if (RT_SUCCESS(rc))
                 {
