posix: add sock to pending_recv list only if not already added
Currently there is possibility of adding a sock to pending_recv list again if sock->pending_recv is true. Check if flag is false before adding to the list. Signed-off-by: Sudheer Mogilappagari <sudheer.mogilappagari@intel.com> Change-Id: Ie23e1e8dbe1aa5594d9ddea30e7f235e3bf8ddad Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6381 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Ziye Yang <ziye.yang@intel.com>
This commit is contained in:
parent
83601f77bc
commit
4ac5ca6558
@ -922,8 +922,10 @@ posix_sock_read(struct spdk_posix_sock *sock)
|
||||
* for correctness let's handle it. */
|
||||
if (!sock->pending_recv && sock->base.group_impl) {
|
||||
group = __posix_group_impl(sock->base.group_impl);
|
||||
TAILQ_INSERT_TAIL(&group->pending_recv, sock, link);
|
||||
sock->pending_recv = true;
|
||||
if (!sock->pending_recv) {
|
||||
TAILQ_INSERT_TAIL(&group->pending_recv, sock, link);
|
||||
sock->pending_recv = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user