Commit b2e778b2 authored by Seth Howell's avatar Seth Howell Committed by Jim Harris
Browse files

nvme_ns_cmd: fix bug in split_request_sgl



The while loop in this function was structured such that if the final
child request did not contain a full number of SGE elements, it would be
truncated. We need to not only check whether we have a full number of
SGEs, but also if the current child has consumed the end of the parent
request.

Change-Id: I7df6c224e9ab66033c92d2cf1af10452f5cdfd9b
Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450684


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent c459cb6e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -382,7 +382,7 @@ _nvme_ns_cmd_split_request_sgl(struct spdk_nvme_ns *ns,
		req_current_length += sge_length;
		num_sges++;

		if (num_sges < max_sges) {
		if (num_sges < max_sges && req_current_length < req->payload_size) {
			continue;
		}