nvme: don't send Identify NS ID Descriptor List to inactive NS
The specification says it will return INVALID FIELD if the NS is in inactive state. Fix issue #1551. Change-Id: I1b32f023ed665d410f4705e439068699e2b2f8de Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3860 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
fdf2490a32
commit
5adf099eed
@ -373,6 +373,11 @@ int nvme_ns_construct(struct spdk_nvme_ns *ns, uint32_t id,
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* skip Identify NS ID Descriptor List for inactive NS */
|
||||
if (!spdk_nvme_ctrlr_is_active_ns(ctrlr, id)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return nvme_ctrlr_identify_id_desc(ns);
|
||||
}
|
||||
|
||||
|
@ -46,6 +46,9 @@ DEFINE_STUB(nvme_wait_for_completion_robust_lock, int,
|
||||
struct nvme_completion_poll_status *status,
|
||||
pthread_mutex_t *robust_mutex), 0);
|
||||
|
||||
DEFINE_STUB(spdk_nvme_ctrlr_is_active_ns, bool,
|
||||
(struct spdk_nvme_ctrlr *ctrlr, uint32_t nsid), 1);
|
||||
|
||||
int
|
||||
nvme_ctrlr_cmd_identify(struct spdk_nvme_ctrlr *ctrlr, uint8_t cns, uint16_t cntid, uint32_t nsid,
|
||||
void *payload, size_t payload_size,
|
||||
|
Loading…
Reference in New Issue
Block a user