Commit c83ffe32 authored by Tomasz Zawadzki's avatar Tomasz Zawadzki
Browse files

ut/bdev: dont poll threads recursively



free_bdev() polls threads to push the bdev unregister forward.
get_device_stat_test called the free_bdev() within a callback,
which results in polling threads recursively.

Discovered while working on asynchronous registration for bdevs.

Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ib4f6f50c1542d11e98f8ba093710620cca016eb4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5211


Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 5338dabb
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -455,7 +455,6 @@ get_device_stat_cb(struct spdk_bdev *bdev, struct spdk_bdev_io_stat *stat, void
	CU_ASSERT_STRING_EQUAL(bdev_name, "bdev0");

	free(stat);
	free_bdev(bdev);

	*(bool *)cb_arg = true;
}
@@ -512,7 +511,7 @@ get_device_stat_test(void)
	spdk_bdev_get_device_stat(bdev, stat, get_device_stat_cb, &done);
	while (!done) { poll_threads(); }


	free_bdev(bdev);
}

static void