lib/ftl: Free IO in case band's relocation was interrupted by shutdown
This leak could be detected by ASAN in FTL CI tests. Change-Id: I3ab7317dd5288b9fc808fb476627213b00860eb8 Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448566 Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
51515d874a
commit
660a0fae82
@ -624,10 +624,26 @@ ftl_band_reloc_init(struct ftl_reloc *reloc, struct ftl_band_reloc *breloc,
|
||||
static void
|
||||
ftl_band_reloc_free(struct ftl_band_reloc *breloc)
|
||||
{
|
||||
struct ftl_reloc *reloc = breloc->parent;
|
||||
struct ftl_io *io;
|
||||
size_t i, num_ios;
|
||||
|
||||
if (!breloc) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (breloc->active) {
|
||||
num_ios = spdk_ring_dequeue(breloc->write_queue, (void **)reloc->io, reloc->max_qdepth);
|
||||
for (i = 0; i < num_ios; ++i) {
|
||||
io = reloc->io[i];
|
||||
if (io->flags & FTL_IO_INITIALIZED) {
|
||||
ftl_reloc_free_io(breloc, io);
|
||||
}
|
||||
}
|
||||
|
||||
ftl_reloc_release_io(breloc);
|
||||
}
|
||||
|
||||
spdk_ring_free(breloc->free_queue);
|
||||
spdk_ring_free(breloc->write_queue);
|
||||
spdk_bit_array_free(&breloc->reloc_map);
|
||||
|
Loading…
x
Reference in New Issue
Block a user