Step 250: Select at least one written block for replacing the erased block.
In Step 210, the controller 120 performs erasing an operation on at least one written block in the spare pool 138, to make the at least one written block (e.g. SB_7) be converted into an erase state from a written state (e.g. a programmed state), as a preparation for future writing operations. Step 210 may take place before the host device 200 issues a writing command, or after the controller 120 performs writing on another erased block. In Step 220, the controller 120 creates a timestamp of the at least one erased block. In Step 230, the controller 120 refers to the time information and system time in the timestamp to determine whether the time the at least one erased block is in the erase state exceeds a threshold. This step is meant to protect erased blocks from suffering, to prevent it from suffering unrecoverable physical damage. If the determination result in Step 230 is “Yes”, the flow goes to Step 230; if not, the flow stays in the current step. In Step 240, since the controller 120 already finds that the erasing period of the at least one erased block has exceeded the threshold, which suggests that the erased block is in danger of being damaged, the controller 120 will perform writing on the at least one erased block to convert the block from the erase state to the written state, in order to prevent some potential damages.