Patent ID: 8015435

Claim:
A method for controlling a controller connected to a plurality of storage units storing data, the controller including a cache, a data buffer, and a parity buffer, the method comprising: storing updated data to be written into a first storage unit in the cache, the plurality of storage units including the first storage unit and a second storage unit; reading old data related to the updated data from the first storage unit and storing the read old data in the data buffer; generating updated parity data corresponding to the updated data stored in the cache and storing the updated parity data in the parity buffer; writing the updated data stored in the cache into the first storage unit and the updated parity data stored in the parity buffer into the second storage unit; comparing the updated parity data stored in the parity buffer with the updated parity data written into and read out from the second storage unit; writing the old data stored in the data buffer back to the first storage unit so as to maintain consistency between data in the plurality of storage units when the updated parity data stored in the parity buffer is different from the updated parity data read out from the second storage unit; deleting the updated parity data from the parity buffer; and regenerating updated parity data by using the updated data stored in the cache and rewriting the regenerated updated parity data into the second storage unit.