Commit 01aa5cb3 authored by Ben Walker's avatar Ben Walker Committed by Tomasz Zawadzki
Browse files

sock/posix: Clear sock from pending_recv even if user does large read



If there was an EPOLLIN event the socket gets adding to the pending_recv
list. But if the application then does a very large read, it will bypass
the logic that clears the socket from the pending_recv list. Fix this.

Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
Change-Id: Ia0ba86012f7c6dfd14eb43ba6eeed94dbbce90ce
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6744


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 8e7d5592
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -944,6 +944,10 @@ posix_sock_readv(struct spdk_sock *_sock, struct iovec *iov, int iovcnt)
		/* If the user is receiving a sufficiently large amount of data,
		 * receive directly to their buffers. */
		if (len >= MIN_SOCK_PIPE_SIZE) {
			if (group && sock->pending_recv) {
				sock->pending_recv = false;
				TAILQ_REMOVE(&group->pending_recv, sock, link);
			}
			return readv(sock->fd, iov, iovcnt);
		}