Methods, systems, and computer program products for preserving atomic
writes to disk arrays are disclosed. According to one method, portions of
a file are stored in paired locations on a disk array such that a first
location of a location pair for a file portion stores scratch data for
the file portion and a second portion of the location pair for the file
portion stores valid data for the file portion. A bitmap is stored on the
disk array. The bitmap has bits indicating whether valid data for each
file portion resides in the first or the second location for its
respective location pair. A write request to write data to a portion of
the file being less than the entire file is received. The bitmap
indicates that valid data for the portion of the file to be written to
resides in a first memory location of one of the location pairs on the
disk array. In response to the write request, the bitmap is copied to
memory, the data for the portion of the file requested to be modified is
copied from the first location of the one location pair to a second
location of the one location pair on the disk array without copying the
entire file and modifying the data in the second location based on the
data to be written. The bitmap stored in memory is modified to indicate
that valid data for the portion of the file resides in the second
location of the one location pair and that scratch data for the portion
of the file resides in the first location on the disk array. A request to
save the modification is received, and, in response to the request to
save the modified data, the bitmap stored on the disk array is replaced
with the modified bitmap.