Commit 3126157a authored by Changpeng Liu's avatar Changpeng Liu Committed by Jim Harris
Browse files

bdev_nvme: set to deactive state when deleting NS bdev



Since the number of NVMe controller's Namespace is a const
variable, so the Namespace block device is a static array,
and is assigned with NSID after initialization, so when
users want to delete a specified block device, we can
just change it into inactive state.

Fix issue #495.

Change-Id: Ie6e33ad59f2375cc2b5099624bfe1ef6918a6264
Signed-off-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/433543


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 2706cd42
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -282,7 +282,7 @@ bdev_nvme_destruct(void *ctx)
	pthread_mutex_lock(&g_bdev_nvme_mutex);
	nvme_ctrlr->ref--;
	free(nvme_disk->disk.name);
	memset(nvme_disk, 0, sizeof(*nvme_disk));
	nvme_disk->active = false;
	if (nvme_ctrlr->ref == 0 && nvme_ctrlr->destruct) {
		/* Clear destruct sign in case of reentering controller destruct */
		nvme_ctrlr->destruct = false;