Commit 3b7f3909 authored by Ziye Yang's avatar Ziye Yang Committed by Konrad Sztyber
Browse files

sock/uring: Fix the defect of using is_zcopy field in task.



There is a defect related with the paramater passing.
We should use a variable to store the value first.
We should not directly pass task->zcopy to this function and
reset this variable after the function, because we want to avoid the
recursive calling issue.

Signed-off-by: default avatarZiye Yang <ziye.yang@intel.com>
Change-Id: I674eb8c6d56704d6508e5753edb6d9233f6f434a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15378


Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarXiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
parent 817c39a1
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1122,6 +1122,7 @@ sock_uring_group_reap(struct spdk_uring_sock_group_impl *group, int max, int max
	struct spdk_uring_sock *sock, *tmp;
	struct spdk_uring_task *task;
	int status;
	bool is_zcopy;

	for (i = 0; i < max; i++) {
		ret = io_uring_peek_cqe(&group->uring, &cqe);
@@ -1170,12 +1171,13 @@ sock_uring_group_reap(struct spdk_uring_sock_group_impl *group, int max, int max
		case SPDK_SOCK_TASK_WRITE:
			task->last_req = NULL;
			task->iov_cnt = 0;
			is_zcopy = task->is_zcopy;
			task->is_zcopy = false;
			if (spdk_unlikely(status) < 0) {
				sock->connection_status = status;
				spdk_sock_abort_requests(&sock->base);
			} else {
				sock_complete_write_reqs(&sock->base, status, task->is_zcopy);
				sock_complete_write_reqs(&sock->base, status, is_zcopy);
			}

			break;