Commit 6a5984e8 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Jim Harris
Browse files

nvmf_rpc: Remove -EBUSY handling from RPCs to pause/resume subsystem



After the commit 2881f7f6, spdk_nvmf_subsystem_pause() no longer
returns -EBUSY when a subsystem is in changing state. Remove the related
check from RPCs to pause/resume subsystem.

Signed-off-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Suggested-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I7ad0cf5fa139d244565feae61ceda27c5f4894cb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/24922


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
parent bc06e05a
Loading
Loading
Loading
Loading
+5 −30
Original line number Diff line number Diff line
@@ -938,12 +938,7 @@ rpc_nvmf_subsystem_add_listener(struct spdk_jsonrpc_request *request,

	rc = spdk_nvmf_subsystem_pause(subsystem, 0, nvmf_rpc_listen_paused, ctx);
	if (rc != 0) {
		if (rc == -EBUSY) {
			spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR,
							 "subsystem busy, retry later.");
		} else {
		spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR, "Internal error");
		}
		nvmf_rpc_listener_ctx_free(ctx);
	}
}
@@ -1017,12 +1012,7 @@ rpc_nvmf_subsystem_remove_listener(struct spdk_jsonrpc_request *request,

	rc = spdk_nvmf_subsystem_pause(subsystem, 0, nvmf_rpc_listen_paused, ctx);
	if (rc != 0) {
		if (rc == -EBUSY) {
			spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR,
							 "subsystem busy, retry later.");
		} else {
		spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR, "Internal error");
		}
		nvmf_rpc_listener_ctx_free(ctx);
	}
}
@@ -1584,12 +1574,7 @@ rpc_nvmf_subsystem_add_ns(struct spdk_jsonrpc_request *request,

	rc = spdk_nvmf_subsystem_pause(subsystem, ctx->ns_params.nsid, nvmf_rpc_ns_paused, ctx);
	if (rc != 0) {
		if (rc == -EBUSY) {
			spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR,
							 "subsystem busy, retry later.");
		} else {
		spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR, "Internal error");
		}
		nvmf_rpc_ns_ctx_free(ctx);
	}
}
@@ -1704,12 +1689,7 @@ rpc_nvmf_subsystem_remove_ns(struct spdk_jsonrpc_request *request,

	rc = spdk_nvmf_subsystem_pause(subsystem, ctx->nsid, nvmf_rpc_remove_ns_paused, ctx);
	if (rc != 0) {
		if (rc == -EBUSY) {
			spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR,
							 "subsystem busy, retry later.");
		} else {
		spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR, "Internal error");
		}
		nvmf_rpc_remove_ns_ctx_free(ctx);
	}
}
@@ -1829,12 +1809,7 @@ nvmf_rpc_ns_visible(struct spdk_jsonrpc_request *request,

	rc = spdk_nvmf_subsystem_pause(subsystem, ctx->nsid, nvmf_rpc_ns_visible_paused, ctx);
	if (rc != 0) {
		if (rc == -EBUSY) {
			spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR,
							 "subsystem busy, retry later.");
		} else {
		spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR, "Internal error");
		}
		nvmf_rpc_ns_visible_ctx_free(ctx);
	}
}