576a373d58
Use another list dedicated to hold queued requests being aborted to avoid potential infinite recursive calls. Add a helper function nvme_qpair_abort_queued_req() to move requests whose cb_arg matches from qpair->queued_req to qpair->aborted_queued_req. Then nvme_qpair_resubmit_requests() aborts all requests in qpair->aborted_queued_req. The first idea was that nvme_qpair_abort_queued_req() aborts queued requests directly. However, this caused infinite recursive calls. Hence separate requesting abort to queued requests and actually aborting queued requests. The detail of the infinite recursive calls is as follows: Some SPDK tool submits the next request from the callback to the completion of a request in the completion polling loop. For such tool, if the callback submits a request and then aborts the request immediately, and the request could not be submitted but queued, it will create infinite recursive calls by request submit and abort, and it will not be able to get out of completion polling loop. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I8196182b981bc52dee2074d7642498a5d6ef97d4 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2891 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>