lib/ftl: Don't retry on write failure
Retrying on write errors is generally not needed, by default FTL will fail now in such cases. If retry is preferable, an additional build flag must be supplied. Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com> Change-Id: I8ed1fe140564f08905bdf7fc6d6aa86a7585693a Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14114 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
d1dd6ca814
commit
759e176927
@ -13,6 +13,10 @@ ifdef SPDK_FTL_VSS_EMU
|
||||
CFLAGS += -DSPDK_FTL_VSS_EMU
|
||||
endif
|
||||
|
||||
ifdef SPDK_FTL_RETRY_ON_ERROR
|
||||
CFLAGS += -DSPDK_FTL_RETRY_ON_ERROR
|
||||
endif
|
||||
|
||||
ifdef SPDK_FTL_L2P_FLAT
|
||||
CFLAGS += -DSPDK_FTL_L2P_FLAT
|
||||
endif
|
||||
|
@ -264,8 +264,12 @@ band_open_cb(int status, void *cb_arg)
|
||||
struct ftl_band *band = cb_arg;
|
||||
|
||||
if (spdk_unlikely(status)) {
|
||||
#ifdef SPDK_FTL_RETRY_ON_ERROR
|
||||
ftl_md_persist_entry_retry(&band->md_persist_entry_ctx);
|
||||
return;
|
||||
#else
|
||||
ftl_abort();
|
||||
#endif
|
||||
}
|
||||
|
||||
ftl_band_set_state(band, FTL_BAND_STATE_OPEN);
|
||||
@ -305,8 +309,12 @@ band_close_cb(int status, void *cb_arg)
|
||||
struct ftl_band *band = cb_arg;
|
||||
|
||||
if (spdk_unlikely(status)) {
|
||||
#ifdef SPDK_FTL_RETRY_ON_ERROR
|
||||
ftl_md_persist_entry_retry(&band->md_persist_entry_ctx);
|
||||
return;
|
||||
#else
|
||||
ftl_abort();
|
||||
#endif
|
||||
}
|
||||
|
||||
band->md->p2l_map_checksum = band->p2l_map.band_dma_md->p2l_map_checksum;
|
||||
@ -334,9 +342,13 @@ band_map_write_cb(struct ftl_basic_rq *brq)
|
||||
ftl_md_persist_entry(md, band->id, p2l_map->band_dma_md, NULL,
|
||||
band_close_cb, band, &band->md_persist_entry_ctx);
|
||||
} else {
|
||||
#ifdef SPDK_FTL_RETRY_ON_ERROR
|
||||
/* Try to retry in case of failure */
|
||||
ftl_band_brq_bdev_write(brq);
|
||||
band->queue_depth++;
|
||||
#else
|
||||
ftl_abort();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -362,8 +374,12 @@ band_free_cb(int status, void *ctx)
|
||||
struct ftl_band *band = (struct ftl_band *)ctx;
|
||||
|
||||
if (spdk_unlikely(status)) {
|
||||
#ifdef SPDK_FTL_RETRY_ON_ERROR
|
||||
ftl_md_persist_entry_retry(&band->md_persist_entry_ctx);
|
||||
return;
|
||||
#else
|
||||
ftl_abort();
|
||||
#endif
|
||||
}
|
||||
|
||||
ftl_band_release_p2l_map(band);
|
||||
|
@ -558,8 +558,12 @@ ftl_process_unmap_cb(struct spdk_ftl_dev *dev, struct ftl_md *md, int status)
|
||||
io->dev->unmap_qd--;
|
||||
|
||||
if (spdk_unlikely(status)) {
|
||||
#ifdef SPDK_FTL_RETRY_ON_ERROR
|
||||
TAILQ_INSERT_HEAD(&io->dev->unmap_sq, io, queue_entry);
|
||||
return;
|
||||
#else
|
||||
io->status = status;
|
||||
#endif
|
||||
}
|
||||
|
||||
ftl_io_complete(io);
|
||||
|
@ -443,7 +443,11 @@ chunk_free_cb(int status, void *ctx)
|
||||
chunk->md->close_seq_id = 0;
|
||||
ftl_chunk_free_chunk_free_entry(chunk);
|
||||
} else {
|
||||
#ifdef SPDK_FTL_RETRY_ON_ERROR
|
||||
ftl_md_persist_entry_retry(&chunk->md_persist_entry_ctx);
|
||||
#else
|
||||
ftl_abort();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -858,8 +862,12 @@ compaction_process_ftl_done(struct ftl_rq *rq)
|
||||
|
||||
if (spdk_unlikely(false == rq->success)) {
|
||||
/* IO error retry writing */
|
||||
#ifdef SPDK_FTL_RETRY_ON_ERROR
|
||||
ftl_writer_queue_rq(&dev->writer_user, rq);
|
||||
return;
|
||||
#else
|
||||
ftl_abort();
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Update L2P table */
|
||||
@ -1700,8 +1708,12 @@ chunk_open_cb(int status, void *ctx)
|
||||
struct ftl_nv_cache_chunk *chunk = (struct ftl_nv_cache_chunk *)ctx;
|
||||
|
||||
if (spdk_unlikely(status)) {
|
||||
#ifdef SPDK_FTL_RETRY_ON_ERROR
|
||||
ftl_md_persist_entry_retry(&chunk->md_persist_entry_ctx);
|
||||
return;
|
||||
#else
|
||||
ftl_abort();
|
||||
#endif
|
||||
}
|
||||
|
||||
chunk->md->state = FTL_CHUNK_STATE_OPEN;
|
||||
@ -1761,7 +1773,11 @@ chunk_close_cb(int status, void *ctx)
|
||||
|
||||
chunk->md->state = FTL_CHUNK_STATE_CLOSED;
|
||||
} else {
|
||||
#ifdef SPDK_FTL_RETRY_ON_ERROR
|
||||
ftl_md_persist_entry_retry(&chunk->md_persist_entry_ctx);
|
||||
#else
|
||||
ftl_abort();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -1785,9 +1801,13 @@ chunk_map_write_cb(struct ftl_basic_rq *brq)
|
||||
NULL, chunk_close_cb, chunk,
|
||||
&chunk->md_persist_entry_ctx);
|
||||
} else {
|
||||
#ifdef SPDK_FTL_RETRY_ON_ERROR
|
||||
/* retry */
|
||||
chunk->md->write_pointer -= brq->num_blocks;
|
||||
ftl_chunk_basic_rq_write(chunk, brq);
|
||||
#else
|
||||
ftl_abort();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -139,9 +139,13 @@ ftl_p2l_ckpt_issue_end(int status, void *arg)
|
||||
assert(rq);
|
||||
|
||||
if (status) {
|
||||
#ifdef SPDK_FTL_RETRY_ON_ERROR
|
||||
/* retry */
|
||||
ftl_md_persist_entry_retry(&rq->md_persist_entry_ctx);
|
||||
return;
|
||||
#else
|
||||
ftl_abort();
|
||||
#endif
|
||||
}
|
||||
|
||||
assert(rq->io.band->queue_depth > 0);
|
||||
|
Loading…
Reference in New Issue
Block a user