iscsi: Correct iovec increment when data digest is enabled

iscsi_sgl_append_with_md had not increment _iscsi_sgl::iov
by appended count of iovecs. Hence if data digest is enabled,
data segment will be overwritten by data digest.

This patch fixes the bug.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ibcdacb883b2b97ad86cfc39a035c76264090401d
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456451
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Shuhei Matsumoto 2019-05-31 17:24:26 +09:00 committed by Changpeng Liu
parent 4fa7987047
commit a7d832f28c

View File

@ -638,6 +638,7 @@ _iscsi_sgl_append_with_md(struct _iscsi_sgl *s,
s->iov_offset = 0;
assert(s->iovcnt >= rc);
s->iovcnt -= rc;
s->iov += rc;
if (s->iovcnt == 0) {
return false;