lib/ftl: Add ability to ignore endmeta errors on restore
If a band wasn't closed during shutdown (ie. after dirty shutdown), the start md contains valid data, however end md does not (or it may not be written at all). The config gives the user the ability to specify if encountering this case should result in an error, or if ftl should pad the band with data and recover from closed bands only. Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com> Change-Id: If02f7ca8bc90bb61698fb710fee2274af6af01e4 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455513 Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
9939830608
commit
a9ce7b8551
@ -89,6 +89,9 @@ struct spdk_ftl_conf {
|
|||||||
|
|
||||||
/* Number of interleaving units per ws_opt */
|
/* Number of interleaving units per ws_opt */
|
||||||
size_t num_interleave_units;
|
size_t num_interleave_units;
|
||||||
|
|
||||||
|
/* Allow for partial recovery from open bands instead of returning error */
|
||||||
|
bool allow_open_bands;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Range of parallel units (inclusive) */
|
/* Range of parallel units (inclusive) */
|
||||||
|
@ -90,6 +90,12 @@ static const struct spdk_ftl_conf g_default_conf = {
|
|||||||
/* Number of interleaving units per ws_opt */
|
/* Number of interleaving units per ws_opt */
|
||||||
/* 1 for default and 3 for 3D TLC NAND */
|
/* 1 for default and 3 for 3D TLC NAND */
|
||||||
.num_interleave_units = 1,
|
.num_interleave_units = 1,
|
||||||
|
/*
|
||||||
|
* If clear ftl will return error when restoring after a dirty shutdown
|
||||||
|
* If set, last band will be padded, ftl will restore based only on closed bands - this
|
||||||
|
* will result in lost data after recovery.
|
||||||
|
*/
|
||||||
|
.allow_open_bands = false,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void ftl_dev_free_sync(struct spdk_ftl_dev *dev);
|
static void ftl_dev_free_sync(struct spdk_ftl_dev *dev);
|
||||||
|
@ -573,10 +573,17 @@ ftl_restore_tail_md_cb(struct ftl_io *io, void *ctx, int status)
|
|||||||
struct spdk_ftl_dev *dev = rband->band->dev;
|
struct spdk_ftl_dev *dev = rband->band->dev;
|
||||||
|
|
||||||
if (status) {
|
if (status) {
|
||||||
SPDK_ERRLOG("%s while restoring tail md. Will attempt to pad band %u.\n",
|
if (!dev->conf.allow_open_bands) {
|
||||||
spdk_strerror(status), rband->band->id);
|
SPDK_ERRLOG("%s while restoring tail md in band %u.\n",
|
||||||
STAILQ_INSERT_TAIL(&restore->pad_bands, rband, stailq);
|
spdk_strerror(-status), rband->band->id);
|
||||||
restore->num_pad_bands++;
|
ftl_restore_complete(restore, status);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
SPDK_ERRLOG("%s while restoring tail md. Will attempt to pad band %u.\n",
|
||||||
|
spdk_strerror(-status), rband->band->id);
|
||||||
|
STAILQ_INSERT_TAIL(&restore->pad_bands, rband, stailq);
|
||||||
|
restore->num_pad_bands++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!status && ftl_restore_l2p(rband->band)) {
|
if (!status && ftl_restore_l2p(rband->band)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user