Skip to content

Commit

Permalink
SUNRPC: Don't confuse ENOBUFS with a write_space issue
Browse files Browse the repository at this point in the history
ENOBUFS means that memory allocations are failing due to an actual
low memory situation. It should not be confused with being out of
socket buffer space.

Handle the problem by just punting to the delay in call_status.

Reported-by: Neil Brown <neilb@suse.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
  • Loading branch information
Trond Myklebust committed Jul 3, 2015
1 parent 93aa6c7 commit b5872f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/sunrpc/xprtsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ static int xs_local_send_request(struct rpc_task *task)

switch (status) {
case -ENOBUFS:
break;
case -EAGAIN:
status = xs_nospace(task);
break;
Expand Down Expand Up @@ -692,7 +693,6 @@ static int xs_tcp_send_request(struct rpc_task *task)
status = -ENOTCONN;
/* Should we call xs_close() here? */
break;
case -ENOBUFS:
case -EAGAIN:
status = xs_nospace(task);
break;
Expand All @@ -703,6 +703,7 @@ static int xs_tcp_send_request(struct rpc_task *task)
case -ECONNREFUSED:
case -ENOTCONN:
case -EADDRINUSE:
case -ENOBUFS:
case -EPIPE:
clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags);
}
Expand Down

0 comments on commit b5872f0

Please sign in to comment.