Always make the scratch disk an even multiple of a cylinder in size.
authorBen Pfaff <blp@cs.stanford.edu>
Thu, 16 Oct 2008 22:49:48 +0000 (22:49 +0000)
committerBen Pfaff <blp@cs.stanford.edu>
Thu, 16 Oct 2008 22:49:48 +0000 (22:49 +0000)
The pintos script tried to do so before but "print" and "syswrite"
are buffered differently and interfere with one another.

Thanks to Karan Misra <kmisra@stanford.edu> for pointing out the
problem and confirming the solution.

src/utils/pintos

index d7870351c0e966a9cf1263539aba2a9390bf55c2..fca610a15c83d6c4cdd1e80062d04b1812f5d1f8 100755 (executable)
@@ -259,7 +259,8 @@ sub prepare_scratch_disk {
          foreach @puts;
 
        # Write end-of-archive marker.
-       print { $disks{SCRATCH}{HANDLE} } "\0" x 1024;
+       write_fully ($disks{SCRATCH}{HANDLE}, $disks{SCRATCH}{FILE_NAME},
+                    "\0" x 1024);
     }
 
     # Make sure the scratch disk is big enough to get big files.