Skip to content

Commit 366af48

Browse files
nvmet-fcloop: call done callback even when remote port is gone
JIRA: https://issues.redhat.com/browse/RHEL-114502 When the target port is gone, it's not possible to access any of the request resources. The function should just silently drop the response. The comment is misleading in this regard. Though it's still necessary to call the driver via the ->done callback so the driver is able to release all resources. Reported-by: Yi Zhang <yi.zhang@redhat.com> Closes: https://lore.kernel.org/all/CAHj4cs-OBA0WMt5f7R0dz+rR4HcEz19YLhnyGsj-MRV3jWDsPg@mail.gmail.com/ Fixes: 84eedce ("nvmet-fcloop: drop response if targetport is gone") Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Daniel Wagner <wagi@kernel.org> Signed-off-by: Keith Busch <kbusch@kernel.org> (cherry picked from commit 10c165a) Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
1 parent 39150d7 commit 366af48

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/nvme/target/fcloop.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -496,13 +496,15 @@ fcloop_t2h_xmt_ls_rsp(struct nvme_fc_local_port *localport,
496496
if (!targetport) {
497497
/*
498498
* The target port is gone. The target doesn't expect any
499-
* response anymore and the ->done call is not valid
500-
* because the resources have been freed by
501-
* nvmet_fc_free_pending_reqs.
499+
* response anymore and thus lsreq can't be accessed anymore.
502500
*
503501
* We end up here from delete association exchange:
504502
* nvmet_fc_xmt_disconnect_assoc sends an async request.
503+
*
504+
* Return success because this is what LLDDs do; silently
505+
* drop the response.
505506
*/
507+
lsrsp->done(lsrsp);
506508
kmem_cache_free(lsreq_cache, tls_req);
507509
return 0;
508510
}

0 commit comments

Comments
 (0)