1. A method of recovering from an error in a data storage system, the method comprising: a controller detecting an error in a data element stored in a storage array including a plurality of storage devices for storing data and associated error correction codes; and in response to detecting the error in the data element: the controller rebuilding the data element from other data elements and an error correction code in the storage array; and the controller overwriting the error correction code with the rebuilt data element; and after the data element is rebuilt, the controller retaining the rebuilt data element in a storage element that formerly held the error correction code, regenerating the error correction code, and storing the regenerated error correction code in another storage element.