Patent ID: 8245101

Claim:
A method of managing data in a storage device which includes a controller and a flash memory module made up of a plurality of flash memory devices, the method comprising, when the storage device is operatively coupled to a host: performing a first read which includes reading first data and first error correction code (ECC) information, wherein the plurality of flash memory devices are organized in groups each group of which including a plurality of areas, the first read being performed from a first area of a first group of flash memory devices, the first data being associated with a request from an initiator in the host, the initiator having an identifier associated therewith which is one of a plurality of identifiers stored in the storage device; generating second ECC information relating to the first data; and as a result of establishing that the first and second ECC information do not match, performing a first ECC correction operation on the first data and determining whether the first ECC correction was successful resulting in corrected first data and a value specifying the number of corrected errors, such that: if the first ECC correction operation is successful but the number of corrected errors exceeds a threshold, writing the corrected first data to an area of the first group of flash memory devices other than the first area and setting an indicator indicating that the data contained in the first area is invalid and if the number of corrected errors is below or equals the threshold, discarding the corrected first data without writing the corrected first data to the flash memory module; and if the first ECC correction operation is unsuccessful, performing a subsequent ECC correction operation, and if the subsequent ECC correction is not successful, sending an error message to the initiator associated with the first data using the identifier of the initiator associated to the first data.