Index: /trunk/src/VBox/Devices/Storage/VHDHDDCore.cpp
===================================================================
--- /trunk/src/VBox/Devices/Storage/VHDHDDCore.cpp	(revision 24121)
+++ /trunk/src/VBox/Devices/Storage/VHDHDDCore.cpp	(revision 24122)
@@ -1286,4 +1286,5 @@
              */
             rc = vhdFileWriteSync(pImage, pImage->uCurrentEndOfFile, pNewBlock, cbNewBlock, NULL);
+            AssertRC(rc);
 
             /*
@@ -1293,4 +1294,8 @@
             pImage->uCurrentEndOfFile += cbNewBlock;
             RTMemFree(pNewBlock);
+
+            /* Write the updated BAT and the footer to remain in a consistent state. */
+            rc = vhdFlush(pImage);
+            AssertRC(rc);
         }
 
