Patent ID: 8510502

Claim:
A data writing method for a rewritable non-volatile memory module, wherein the rewritable non-volatile memory module has a plurality of physical blocks, each of the physical blocks has a plurality of physical pages, the physical blocks are grouped into at least a data area and a spare area, a plurality of logical blocks is configured to map to the physical blocks belonging to the data area, each of the logical blocks has a plurality of logical pages, a plurality of physical blocks are respectively selected from the spare area as a plurality of substitute physical blocks corresponding to a plurality of updated physical blocks among the physical blocks belonging to the data area, and the data writing method comprises: selecting at least one physical block from the spare area as a reserved physical block for the updated physical blocks; receiving a write command and updated data corresponding to the write command from a host system, wherein the write command indicates to write the updated data starting from a first logical page among the logical pages, the first logical page belongs to a first logical block among the logical blocks, and the first logical block maps to a first updated physical block among the updated physical blocks; determining whether a first substitute physical block corresponding to the first updated physical block stores data belonging to the first logical page; and when the first substitute physical block stores the data belonging to the first logical page, independently assigning the reserved physical block to the first updated physical block and writing the updated data into the reserved physical block, wherein the reserved physical block only stores data belonging to the same logical block.