diff options
author | Andy Grover <andy.grover@oracle.com> | 2009-07-17 09:13:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-20 11:03:12 -0400 |
commit | edacaeae52ade6cbb3a0704db32a9fb4a219dee3 (patch) | |
tree | cbc5792cba5b5b757e018570393f76466407c3f7 /net/rds | |
parent | fdf6e6b4afd8a56fa58f70a3950bd7ea7fbaef5f (diff) |
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: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds')
-rw-r--r-- | net/rds/recv.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/net/rds/recv.c b/net/rds/recv.c index f2118c51cfa3..86bc1a06ebbd 100644 --- a/net/rds/recv.c +++ b/net/rds/recv.c | |||
@@ -409,18 +409,18 @@ int rds_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, | |||
409 | if (msg_flags & MSG_OOB) | 409 | if (msg_flags & MSG_OOB) |
410 | goto out; | 410 | goto out; |
411 | 411 | ||
412 | /* If there are pending notifications, do those - and nothing else */ | 412 | while (1) { |
413 | if (!list_empty(&rs->rs_notify_queue)) { | 413 | /* If there are pending notifications, do those - and nothing else */ |
414 | ret = rds_notify_queue_get(rs, msg); | 414 | if (!list_empty(&rs->rs_notify_queue)) { |
415 | goto out; | 415 | ret = rds_notify_queue_get(rs, msg); |
416 | } | 416 | break; |
417 | } | ||
417 | 418 | ||
418 | if (rs->rs_cong_notify) { | 419 | if (rs->rs_cong_notify) { |
419 | ret = rds_notify_cong(rs, msg); | 420 | ret = rds_notify_cong(rs, msg); |
420 | goto out; | 421 | break; |
421 | } | 422 | } |
422 | 423 | ||
423 | while (1) { | ||
424 | if (!rds_next_incoming(rs, &inc)) { | 424 | if (!rds_next_incoming(rs, &inc)) { |
425 | if (nonblock) { | 425 | if (nonblock) { |
426 | ret = -EAGAIN; | 426 | ret = -EAGAIN; |
@@ -428,7 +428,9 @@ int rds_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, | |||
428 | } | 428 | } |
429 | 429 | ||
430 | timeo = wait_event_interruptible_timeout(*sk->sk_sleep, | 430 | timeo = wait_event_interruptible_timeout(*sk->sk_sleep, |
431 | rds_next_incoming(rs, &inc), | 431 | (!list_empty(&rs->rs_notify_queue) |
432 | || rs->rs_cong_notify | ||
433 | || rds_next_incoming(rs, &inc)), | ||
432 | timeo); | 434 | timeo); |
433 | rdsdebug("recvmsg woke inc %p timeo %ld\n", inc, | 435 | rdsdebug("recvmsg woke inc %p timeo %ld\n", inc, |
434 | timeo); | 436 | timeo); |