Revert "nvmf: disconnect other connections if admin qpair disconnects."
This seems to be causing a new intermittent test failure with a call stack that looks like: # nvme disconnect -n nqn.2016-06.io.spdk:cnode1 transport.c:175:23: runtime error: member access within misaligned address 0x000000004321 for type 'const struct spdk_nvmf_transport_ops', which requires 8 byte alignment 0x000000004321: note: pointer points here <memory cannot be printed> #0 0x4e014b in spdk_nvmf_transport_qpair_fini #1 0x4f14fe in nvmf_qpair_fini #2 0x502a95 in _spdk_reactor_msg_passed This reverts commit adfa9f6dc75d4c541beeb3269442552f7cbf5d7a. Change-Id: I4bab9d8b5294e241c960683df14acbf457bf3391 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-on: https://review.gerrithub.io/409251 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
145b2f7bd3
commit
87ec451b07
@ -275,13 +275,23 @@ end:
|
||||
}
|
||||
|
||||
static void
|
||||
_ctrlr_destruct_check(void *ctx)
|
||||
ctrlr_delete_qpair(void *ctx)
|
||||
{
|
||||
struct spdk_nvmf_ctrlr *ctrlr = ctx;
|
||||
struct spdk_nvmf_qpair *qpair = ctx;
|
||||
struct spdk_nvmf_ctrlr *ctrlr = qpair->ctrlr;
|
||||
|
||||
assert(ctrlr != NULL);
|
||||
assert(ctrlr->num_qpairs > 0);
|
||||
/* Defer the admin qpair deletion since there are still io qpairs */
|
||||
if ((ctrlr->num_qpairs > 1) && (qpair == ctrlr->admin_qpair)) {
|
||||
spdk_thread_send_msg(qpair->group->thread, ctrlr_delete_qpair, qpair);
|
||||
return;
|
||||
}
|
||||
|
||||
ctrlr->num_qpairs--;
|
||||
TAILQ_REMOVE(&ctrlr->qpairs, qpair, link);
|
||||
spdk_nvmf_transport_qpair_fini(qpair);
|
||||
|
||||
if (ctrlr->num_qpairs == 0) {
|
||||
assert(ctrlr->subsys != NULL);
|
||||
assert(ctrlr->subsys->thread != NULL);
|
||||
@ -289,41 +299,6 @@ _ctrlr_destruct_check(void *ctx)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
nvmf_qpair_fini(void *ctx)
|
||||
{
|
||||
struct spdk_nvmf_qpair *qpair = ctx;
|
||||
struct spdk_nvmf_ctrlr *ctrlr = qpair->ctrlr;
|
||||
struct spdk_thread *admin_thread = ctrlr->admin_qpair->group->thread;
|
||||
|
||||
spdk_nvmf_transport_qpair_fini(qpair);
|
||||
spdk_thread_send_msg(admin_thread, _ctrlr_destruct_check, ctrlr);
|
||||
}
|
||||
|
||||
static void
|
||||
ctrlr_delete_qpair(void *ctx)
|
||||
{
|
||||
struct spdk_nvmf_qpair *qpair = ctx, *_qpair, *tmp;
|
||||
struct spdk_nvmf_ctrlr *ctrlr = qpair->ctrlr;
|
||||
|
||||
assert(ctrlr != NULL);
|
||||
|
||||
/* Delete all io qpairs if receving the admin qpair disconnect event early */
|
||||
if ((ctrlr->num_qpairs > 1) && (qpair == ctrlr->admin_qpair)) {
|
||||
TAILQ_FOREACH_SAFE(_qpair, &ctrlr->qpairs, link, tmp) {
|
||||
if (_qpair != qpair) {
|
||||
ctrlr_delete_qpair(_qpair);
|
||||
}
|
||||
}
|
||||
|
||||
spdk_thread_send_msg(qpair->group->thread, ctrlr_delete_qpair, qpair);
|
||||
return;
|
||||
}
|
||||
|
||||
TAILQ_REMOVE(&ctrlr->qpairs, qpair, link);
|
||||
spdk_thread_send_msg(qpair->group->thread, nvmf_qpair_fini, qpair);
|
||||
}
|
||||
|
||||
static void
|
||||
_spdk_nvmf_ctrlr_add_io_qpair(void *ctx)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user