bdevperf: Hold io_target_groups until exiting bdevperf
Previously bdevperf_free_targets() had freed not only io_targets but also io_target_groups. This had made repeated runs by RPC impossible. This patch series will fix this issue later but we cannot wait for that and fix the issue now. Fixes #1139. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I88cf5725579b704bc3826bd4c0b2dd9f4e70db30 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/479912 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
116a4afcc3
commit
9b36011acc
@ -257,6 +257,17 @@ error:
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void
|
||||
blockdev_heads_destroy(void)
|
||||
{
|
||||
struct io_target_group *group, *tmp;
|
||||
|
||||
TAILQ_FOREACH_SAFE(group, &g_bdevperf.groups, link, tmp) {
|
||||
TAILQ_REMOVE(&g_bdevperf.groups, group, link);
|
||||
free(group);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
bdevperf_free_target(struct io_target *target)
|
||||
{
|
||||
@ -280,12 +291,10 @@ bdevperf_free_targets(void)
|
||||
struct io_target *target, *tmp_target;
|
||||
|
||||
TAILQ_FOREACH_SAFE(group, &g_bdevperf.groups, link, tmp_group) {
|
||||
TAILQ_REMOVE(&g_bdevperf.groups, group, link);
|
||||
TAILQ_FOREACH_SAFE(target, &group->targets, link, tmp_target) {
|
||||
TAILQ_REMOVE(&group->targets, target, link);
|
||||
bdevperf_free_target(target);
|
||||
}
|
||||
free(group);
|
||||
}
|
||||
}
|
||||
|
||||
@ -454,6 +463,7 @@ bdevperf_construct_targets(void)
|
||||
static void
|
||||
bdevperf_fini(void)
|
||||
{
|
||||
blockdev_heads_destroy();
|
||||
spdk_app_stop(g_run_rc);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user