From 94164722caf3cffd2de355e3102285133976c77b Mon Sep 17 00:00:00 2001 From: Andy Grover Date: Fri, 17 Jul 2009 13:13:32 +0000 Subject: [PATCH] --- yaml --- r: 159005 b: refs/heads/master c: edacaeae52ade6cbb3a0704db32a9fb4a219dee3 h: refs/heads/master i: 159003: 40b585d111df246cdd95a767f553807110746684 v: v3 --- [refs] | 2 +- trunk/net/rds/recv.c | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/[refs] b/[refs] index ef635109e498..f58ebdc1a8aa 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fdf6e6b4afd8a56fa58f70a3950bd7ea7fbaef5f +refs/heads/master: edacaeae52ade6cbb3a0704db32a9fb4a219dee3 diff --git a/trunk/net/rds/recv.c b/trunk/net/rds/recv.c index f2118c51cfa3..86bc1a06ebbd 100644 --- a/trunk/net/rds/recv.c +++ b/trunk/net/rds/recv.c @@ -409,18 +409,18 @@ int rds_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, if (msg_flags & MSG_OOB) goto out; - /* If there are pending notifications, do those - and nothing else */ - if (!list_empty(&rs->rs_notify_queue)) { - ret = rds_notify_queue_get(rs, msg); - goto out; - } + while (1) { + /* If there are pending notifications, do those - and nothing else */ + if (!list_empty(&rs->rs_notify_queue)) { + ret = rds_notify_queue_get(rs, msg); + break; + } - if (rs->rs_cong_notify) { - ret = rds_notify_cong(rs, msg); - goto out; - } + if (rs->rs_cong_notify) { + ret = rds_notify_cong(rs, msg); + break; + } - while (1) { if (!rds_next_incoming(rs, &inc)) { if (nonblock) { ret = -EAGAIN; @@ -428,7 +428,9 @@ int rds_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, } 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); rdsdebug("recvmsg woke inc %p timeo %ld\n", inc, timeo);