- /* XXX: this is a hack. We are going to "treat" every byte twice; write it, and then verify it. Double the
- * bytes totals so that progress works itself out (assuming write is the same speed as read).
- */
- total_bytes *= 2;
- copy (dcp_path, "/mp", total_bytes, total_bytes);
+ uint64_t total_remaining = total_bytes;
+ vector<CopiedFile> copied_files;
+ copy (dcp_path, "/mp", total_remaining, total_bytes, copied_files);
+
+ /* Unmount and re-mount to make sure the write has finished */
+ r = ext4_umount("/mp/");
+ if (r != EOK) {
+ throw CopyError ("Failed to unmount device", r);
+ }
+ r = ext4_mount("ext4_fs", "/mp/", false);
+ if (r != EOK) {
+ throw CopyError ("Failed to mount device", r);
+ }
+ LOG_DISK_NC ("Re-mounted device");
+
+ verify (copied_files, total_bytes);