lib/ftl: Do not put "reloc move" back to move_queue during free

Reloc move should not be put back to move queue
in ftl_reloc_free_move().

Change-Id: I9c84238b9f716e6e73a251e833f32661d17a7eab
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/624
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
This commit is contained in:
Wojciech Malikowski 2020-02-06 11:22:18 -05:00 committed by Tomasz Zawadzki
parent 3505d3a65c
commit a4b7f495f2

View File

@ -245,7 +245,6 @@ ftl_reloc_free_move(struct ftl_band_reloc *breloc, struct ftl_reloc_move *move)
spdk_dma_free(move->data);
memset(move, 0, sizeof(*move));
move->state = FTL_RELOC_STATE_READ;
spdk_ring_enqueue(breloc->move_queue, (void **)&move, 1, NULL);
}
static void
@ -271,6 +270,7 @@ ftl_reloc_write_cb(struct ftl_io *io, void *arg, int status)
}
ftl_reloc_free_move(breloc, move);
spdk_ring_enqueue(breloc->move_queue, (void **)&move, 1, NULL);
}
static void
@ -473,6 +473,7 @@ ftl_reloc_write(struct ftl_band_reloc *breloc, struct ftl_reloc_move *move)
FTL_IO_WRITE, io_flags);
if (!move->io) {
ftl_reloc_free_move(breloc, move);
spdk_ring_enqueue(breloc->move_queue, (void **)&move, 1, NULL);
return -ENOMEM;
}
}
@ -503,6 +504,7 @@ ftl_reloc_read(struct ftl_band_reloc *breloc, struct ftl_reloc_move *move)
move->io = ftl_reloc_io_init(breloc, move, ftl_reloc_read_cb, FTL_IO_READ, 0);
if (!move->io) {
ftl_reloc_free_move(breloc, move);
spdk_ring_enqueue(breloc->move_queue, (void **)&move, 1, NULL);
SPDK_ERRLOG("Failed to initialize io for relocation.");
return -1;
}