nvmf: Bound the maximum number of namespaces that can be configured
Make the bound enormous, but bound it so that we don't run out of memory. Change-Id: I014b3df3be92ae8bd85fea95f514225adc3eefe2 Signed-off-by: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/408247 Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
parent
a00b6819a1
commit
1d94536417
@ -43,6 +43,8 @@
|
||||
|
||||
#define ACCEPT_TIMEOUT_US 10000 /* 10ms */
|
||||
|
||||
#define SPDK_NVMF_MAX_NAMESPACES (1 << 14)
|
||||
|
||||
struct spdk_nvmf_tgt_conf g_spdk_nvmf_tgt_conf;
|
||||
|
||||
static int
|
||||
@ -162,6 +164,8 @@ spdk_nvmf_parse_subsystem(struct spdk_conf_section *sp)
|
||||
|
||||
if (num_ns < 1) {
|
||||
num_ns = 0;
|
||||
} else if (num_ns > SPDK_NVMF_MAX_NAMESPACES) {
|
||||
num_ns = SPDK_NVMF_MAX_NAMESPACES;
|
||||
}
|
||||
|
||||
/* Mode is no longer a valid parameter, but print out a nice
|
||||
|
Loading…
Reference in New Issue
Block a user