lib/ftl: Fix hung up for bdev_ftl_create with wrong block size of zone bdev
If we specify zone bdev whose block size is not 4096 for bdev_ftl_create RPC, SPDK application will hung up because spdk_io_device_unregister() is called for unregistered IO device. Fix this error. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I2ec36dc062edb7867aab892073db3af258808114 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1194 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
This commit is contained in:
parent
bf458c8941
commit
7f6eeaac7d
@ -1399,8 +1399,6 @@ ftl_dev_free_sync(struct spdk_ftl_dev *dev)
|
||||
ftl_dev_dump_bands(dev);
|
||||
ftl_dev_dump_stats(dev);
|
||||
|
||||
spdk_io_device_unregister(dev, NULL);
|
||||
|
||||
if (dev->bands) {
|
||||
for (i = 0; i < ftl_get_num_bands(dev); ++i) {
|
||||
free(dev->bands[i].zone_buf);
|
||||
@ -1571,6 +1569,8 @@ ftl_halt_complete_cb(void *ctx)
|
||||
return;
|
||||
}
|
||||
|
||||
spdk_io_device_unregister(fini_ctx->dev, NULL);
|
||||
|
||||
ftl_dev_free_sync(fini_ctx->dev);
|
||||
if (fini_ctx->cb_fn != NULL) {
|
||||
fini_ctx->cb_fn(NULL, fini_ctx->cb_arg, fini_ctx->halt_complete_status);
|
||||
|
Loading…
Reference in New Issue
Block a user