Commit edacaeae authored by Andy Grover's avatar Andy Grover Committed by David S. Miller
Browse files

RDS: Fix completion notifications on blocking sockets



Completion or congestion notifications were not being checked
if the socket went to sleep. This patch fixes that.
Signed-off-by: default avatarAndy Grover <andy.grover@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fdf6e6b4
...@@ -409,18 +409,18 @@ int rds_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, ...@@ -409,18 +409,18 @@ int rds_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
if (msg_flags & MSG_OOB) if (msg_flags & MSG_OOB)
goto out; goto out;
/* If there are pending notifications, do those - and nothing else */ while (1) {
if (!list_empty(&rs->rs_notify_queue)) { /* If there are pending notifications, do those - and nothing else */
ret = rds_notify_queue_get(rs, msg); if (!list_empty(&rs->rs_notify_queue)) {
goto out; ret = rds_notify_queue_get(rs, msg);
} break;
}
if (rs->rs_cong_notify) { if (rs->rs_cong_notify) {
ret = rds_notify_cong(rs, msg); ret = rds_notify_cong(rs, msg);
goto out; break;
} }
while (1) {
if (!rds_next_incoming(rs, &inc)) { if (!rds_next_incoming(rs, &inc)) {
if (nonblock) { if (nonblock) {
ret = -EAGAIN; ret = -EAGAIN;
...@@ -428,7 +428,9 @@ int rds_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, ...@@ -428,7 +428,9 @@ int rds_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
} }
timeo = wait_event_interruptible_timeout(*sk->sk_sleep, timeo = wait_event_interruptible_timeout(*sk->sk_sleep,
rds_next_incoming(rs, &inc), (!list_empty(&rs->rs_notify_queue)
|| rs->rs_cong_notify
|| rds_next_incoming(rs, &inc)),
timeo); timeo);
rdsdebug("recvmsg woke inc %p timeo %ld\n", inc, rdsdebug("recvmsg woke inc %p timeo %ld\n", inc,
timeo); timeo);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment