Commit 45cb526d authored by Mateusz Kozlowski's avatar Mateusz Kozlowski Committed by Konrad Sztyber
Browse files

lib/ftl: Clear current chunk pointer as soon as it's fully utilized



current_chunk should only really be assigned when it's in open state.

Change-Id: I418e2e2a4d55cc3d3e14e7d8e439b870fb5679b1
Signed-off-by: default avatarMateusz Kozlowski <mateusz.kozlowski@solidigm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20342


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
parent 1c73a5c3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -420,6 +420,10 @@ ftl_nv_cache_get_wr_buffer(struct ftl_nv_cache *nv_cache, struct ftl_io *io)

			/* Move write pointer */
			chunk->md->write_pointer += num_blocks;

			if (free_space == num_blocks) {
				nv_cache->chunk_current = NULL;
			}
			break;
		}