bdev/ftl: unlock g_ftl_bdev_lock before unregister ftl_bdev

There is no need to lock g_ftl_bdev_lock when unregister a ftl_bdev.
Besides, the destructor of ftl_bdev will lock it again.

Change-Id: I99870483183879d9422584dbac6e154f605daea8
Signed-off-by: wuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-on: https://review.gerrithub.io/c/444794
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
wuzhouhui 2019-02-15 09:59:55 +08:00 committed by Jim Harris
parent b9e462e4a6
commit 0238b5c42a

View File

@ -887,9 +887,8 @@ bdev_ftl_delete_bdev(const char *name, spdk_bdev_unregister_cb cb_fn, void *cb_a
LIST_FOREACH_SAFE(ftl_bdev, &g_ftl_bdevs, list_entry, tmp) {
if (strcmp(ftl_bdev->bdev.name, name) == 0) {
spdk_bdev_unregister(&ftl_bdev->bdev, cb_fn, cb_arg);
pthread_mutex_unlock(&g_ftl_bdev_lock);
spdk_bdev_unregister(&ftl_bdev->bdev, cb_fn, cb_arg);
return;
}
}