A method of controlling a memory system comprising a nonvolatile memory including a plurality of blocks each including a plurality of pages, and enabling reading of data written in one page among the plurality of pages of each block after writing of data to one or more pages subsequent to the one page, the method comprising:
- in response to receiving a read command from a host, incrementing a first counter value corresponding to a first block having a block address allocated to a logical address of read target data specified by the received read command, wherein the first counter value is among a plurality of first counter values corresponding to the plurality of blocks;
- reading the read target data from the first block or a buffer depending on whether or not the read target data is readable from the first block, and decrementing the first counter value corresponding to the first block after the reading has been finished, the buffer being a first buffer in the memory system or a write buffer of the host;
- wherein in response to determining the first block is a first write destination block among a plurality of write destination blocks allocated from the plurality of blocks and the read target data is not readable from the first write destination block, incrementing a second counter value corresponding to the first write destination block among a plurality of second counter values corresponding to the plurality of write destination blocks, reading the read target data from the buffer, and decrementing the second counter value corresponding to the first write destination block after the reading has been finished;
- and
- prohibiting processing for transitioning a state of a block associated with an uncompleted read command to a state reusable as a new write destination block, on the basis of the plurality of first counter values, and prohibiting release of a first region in the buffer, on the basis of the plurality of second counter values, the first region being a region that stores data being written or waiting to be written to a write destination block associated with an uncompleted read command that requires reading of data from the buffer.