Commit e8f382b8 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

nbd: fix hot remove path



If block device is removed, we need to allow outstanding I/O to complete
normally rather than moving them to processing_io_list - otherwise we get
double completion errors.

Fixes issue #3163.

Signed-off-by: default avatarJim Harris <jim.harris@samsung.com>
Change-Id: If5d57e372527ef1297a1afb807522d14b8041fd9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/21374


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 780cb81f
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -829,7 +829,7 @@ nbd_poll(void *arg)
		_nbd_stop(nbd);
		return SPDK_POLLER_IDLE;
	}
	if (nbd->is_closing) {
	if (nbd->is_closing && nbd->io_count == 0) {
		spdk_nbd_stop(nbd);
	}

@@ -861,9 +861,6 @@ nbd_bdev_hot_remove(struct spdk_nbd_disk *nbd)

	TAILQ_FOREACH_SAFE(io, &nbd->received_io_list, tailq, io_tmp) {
		TAILQ_REMOVE(&nbd->received_io_list, io, tailq);
		TAILQ_INSERT_TAIL(&nbd->processing_io_list, io, tailq);
	}
	TAILQ_FOREACH_SAFE(io, &nbd->processing_io_list, tailq, io_tmp) {
		nbd_io_done(NULL, false, io);
	}
}