Commit 7b74274f authored by Changpeng Liu's avatar Changpeng Liu
Browse files

nvmf: add parameter check when loading reservation information from a JSON file



Change-Id: Id217212fd82e57a4cfb32f62f11798c72187879e
Signed-off-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460794


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 390cffb6
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1459,6 +1459,12 @@ spdk_nvmf_ns_load_reservation(const char *file, struct spdk_nvmf_reservation_inf
		goto exit;
	}

	if (res.regs.num_regs > SPDK_NVMF_MAX_NUM_REGISTRANTS) {
		SPDK_ERRLOG("Can only support up to %u registrants\n", SPDK_NVMF_MAX_NUM_REGISTRANTS);
		rc = -ERANGE;
		goto exit;
	}

	rc = 0;
	info->ptpl_activated = res.ptpl_activated;
	info->rtype = res.rtype;