diff --git a/module/sock/posix/posix.c b/module/sock/posix/posix.c index e61e4fae0..ce8b10b8a 100644 --- a/module/sock/posix/posix.c +++ b/module/sock/posix/posix.c @@ -1178,7 +1178,8 @@ _sock_check_zcopy(struct spdk_sock *sock) * we encounter one match we can stop looping as soon as a * non-match is found. */ - for (idx = serr->ee_info; idx <= serr->ee_data; idx++) { + idx = serr->ee_info; + while (true) { found = false; TAILQ_FOREACH_SAFE(req, &sock->pending_reqs, internal.link, treq) { if (!req->internal.is_zcopy) { @@ -1197,6 +1198,16 @@ _sock_check_zcopy(struct spdk_sock *sock) break; } } + + if (idx == serr->ee_data) { + break; + } + + if (idx == UINT32_MAX) { + idx = 0; + } else { + idx++; + } } }