From 7c331adfebe91311796bddd6d7115eec118a4d56 Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Wed, 10 Apr 2019 02:48:53 -0400 Subject: [PATCH] nvmf: update the subsystem poll group's reservation information correctly Existing condition for updating subsystem poll group's reservation information is wrong, when received the RELEASE command, the reservation type may be changed to none, but it will not be saved to the subsystem's poll group. Change-Id: Idc177a0f03fb9611d6eda1e25a5b90caaa73d1be Signed-off-by: Changpeng Liu Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450727 Reviewed-by: Liang Yan Reviewed-by: Jim Harris Tested-by: SPDK CI Jenkins --- lib/nvmf/nvmf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/nvmf/nvmf.c b/lib/nvmf/nvmf.c index 3b9f01e36..344bdabb7 100644 --- a/lib/nvmf/nvmf.c +++ b/lib/nvmf/nvmf.c @@ -951,10 +951,12 @@ poll_group_update_subsystem(struct spdk_nvmf_poll_group *group, if (ns == NULL) { memset(&sgroup->ns_info[i], 0, sizeof(struct spdk_nvmf_subsystem_pg_ns_info)); - } else if (ns->rtype && ns->holder) { + } else { sgroup->ns_info[i].crkey = ns->crkey; sgroup->ns_info[i].rtype = ns->rtype; - sgroup->ns_info[i].holder_id = ns->holder->hostid; + if (ns->holder) { + sgroup->ns_info[i].holder_id = ns->holder->hostid; + } memset(&sgroup->ns_info[i].reg_hostid, 0, SPDK_NVMF_MAX_NUM_REGISTRANTS * sizeof(struct spdk_uuid)); j = 0;