lib/ftl: Initialize band tail metadata physical address

Band tail PPA should be initialized when
new FTL instance is created.

Change-Id: Ie2fb72aa3f29eece0b6f8912998b33af3ba6b355
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457777
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Wojciech Malikowski 2019-06-12 07:03:55 -04:00 committed by Darek Stojaczyk
parent 4be37a57f4
commit bfd67f9405
4 changed files with 9 additions and 5 deletions

View File

@ -138,7 +138,6 @@ ftl_band_write_failed(struct ftl_band *band)
struct spdk_ftl_dev *dev = band->dev;
band->high_prio = 1;
band->tail_md_ppa = ftl_to_ppa(FTL_PPA_INVALID);
if (!dev->df_band) {
dev->df_band = band;
@ -1085,14 +1084,16 @@ static void
ftl_erase_fail(struct ftl_io *io, int status)
{
struct ftl_chunk *chunk;
struct ftl_band *band = io->band;
char buf[128];
SPDK_ERRLOG("Erase failed @ppa: %s, status: %d\n",
ftl_ppa2str(io->ppa, buf, sizeof(buf)), status);
chunk = ftl_band_chunk_from_ppa(io->band, io->ppa);
chunk = ftl_band_chunk_from_ppa(band, io->ppa);
chunk->state = FTL_CHUNK_STATE_BAD;
ftl_band_remove_chunk(io->band, chunk);
ftl_band_remove_chunk(band, chunk);
band->tail_md_ppa = ftl_band_tail_md_ppa(band);
}
static void

View File

@ -266,7 +266,6 @@ ftl_wptr_close_band(struct ftl_wptr *wptr)
struct ftl_band *band = wptr->band;
ftl_band_set_state(band, FTL_BAND_STATE_CLOSING);
band->tail_md_ppa = wptr->ppa;
return ftl_band_write_tail_md(band, ftl_md_write_cb);
}

View File

@ -377,6 +377,11 @@ ftl_dev_init_bands(struct spdk_ftl_dev *dev)
}
}
for (i = 0; i < ftl_dev_num_bands(dev); ++i) {
band = &dev->bands[i];
band->tail_md_ppa = ftl_band_tail_md_ppa(band);
}
ftl_remove_empty_bands(dev);
out:
free(info);

View File

@ -623,7 +623,6 @@ ftl_restore_tail_md(struct ftl_restore_band *rband)
struct ftl_restore *restore = rband->parent;
struct ftl_band *band = rband->band;
band->tail_md_ppa = ftl_band_tail_md_ppa(band);
band->lba_map.map = restore->lba_map;
band->lba_map.dma_buf = restore->md_buf;