From 10c4193363e70c78e7a4e8dffeabec12b05911de Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Sun, 17 May 2020 11:09:27 +0900 Subject: [PATCH] lib/nvme: Set the parent to failure when submission of any children failed When one of the children is failed to submit, if any children is already submitted, the function can return success to wait for those children to complete, but the parent should be set to failure. Signed-off-by: Shuhei Matsumoto Change-Id: I2ea53856ee58da991bceca0058d1e1f55d42af37 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2492 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Reviewed-by: Ben Walker Reviewed-by: Aleksey Marchuk Reviewed-by: Jim Harris Reviewed-by: Michael Haeuptle --- lib/nvme/nvme_qpair.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/nvme/nvme_qpair.c b/lib/nvme/nvme_qpair.c index 433e41f8c..9c3b3dbe7 100644 --- a/lib/nvme/nvme_qpair.c +++ b/lib/nvme/nvme_qpair.c @@ -650,9 +650,12 @@ _nvme_qpair_submit_request(struct spdk_nvme_qpair *qpair, struct nvme_request *r if (spdk_unlikely(child_req_failed)) { /* part of children requests have been submitted, - * return success for this case. + * return success since we must wait for those children to complete, + * but set the parent request to failure. */ if (req->num_children) { + req->cpl.status.sct = SPDK_NVME_SCT_GENERIC; + req->cpl.status.sc = SPDK_NVME_SC_INTERNAL_DEVICE_ERROR; return 0; } goto error;