diff options
author | Marc Dionne <marc.dionne@auristor.com> | 2019-04-12 11:33:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-12 19:57:23 -0400 |
commit | 8e8715aaa905f6593f610f950d513e81fab5006a (patch) | |
tree | 1c97edf58a373f449bf94ead221dd4bf36881c56 /net/rxrpc | |
parent | 4611da30d679a4b0a2c2b5d4d7b3fbbafc922df7 (diff) |
rxrpc: Allow errors to be returned from rxrpc_queue_packet()
Change rxrpc_queue_packet()'s signature so that it can return any error
code it may encounter when trying to send the packet.
This allows the caller to eventually do something in case of error - though
it should be noted that the packet has been queued and a resend is
scheduled.
Signed-off-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rxrpc')
-rw-r--r-- | net/rxrpc/sendmsg.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/net/rxrpc/sendmsg.c b/net/rxrpc/sendmsg.c index 46c9312085b1..bec64deb7b0a 100644 --- a/net/rxrpc/sendmsg.c +++ b/net/rxrpc/sendmsg.c | |||
@@ -152,12 +152,13 @@ static void rxrpc_notify_end_tx(struct rxrpc_sock *rx, struct rxrpc_call *call, | |||
152 | } | 152 | } |
153 | 153 | ||
154 | /* | 154 | /* |
155 | * Queue a DATA packet for transmission, set the resend timeout and send the | 155 | * Queue a DATA packet for transmission, set the resend timeout and send |
156 | * packet immediately | 156 | * the packet immediately. Returns the error from rxrpc_send_data_packet() |
157 | * in case the caller wants to do something with it. | ||
157 | */ | 158 | */ |
158 | static void rxrpc_queue_packet(struct rxrpc_sock *rx, struct rxrpc_call *call, | 159 | static int rxrpc_queue_packet(struct rxrpc_sock *rx, struct rxrpc_call *call, |
159 | struct sk_buff *skb, bool last, | 160 | struct sk_buff *skb, bool last, |
160 | rxrpc_notify_end_tx_t notify_end_tx) | 161 | rxrpc_notify_end_tx_t notify_end_tx) |
161 | { | 162 | { |
162 | struct rxrpc_skb_priv *sp = rxrpc_skb(skb); | 163 | struct rxrpc_skb_priv *sp = rxrpc_skb(skb); |
163 | unsigned long now; | 164 | unsigned long now; |
@@ -250,7 +251,8 @@ static void rxrpc_queue_packet(struct rxrpc_sock *rx, struct rxrpc_call *call, | |||
250 | 251 | ||
251 | out: | 252 | out: |
252 | rxrpc_free_skb(skb, rxrpc_skb_tx_freed); | 253 | rxrpc_free_skb(skb, rxrpc_skb_tx_freed); |
253 | _leave(""); | 254 | _leave(" = %d", ret); |
255 | return ret; | ||
254 | } | 256 | } |
255 | 257 | ||
256 | /* | 258 | /* |
@@ -423,9 +425,10 @@ static int rxrpc_send_data(struct rxrpc_sock *rx, | |||
423 | if (ret < 0) | 425 | if (ret < 0) |
424 | goto out; | 426 | goto out; |
425 | 427 | ||
426 | rxrpc_queue_packet(rx, call, skb, | 428 | ret = rxrpc_queue_packet(rx, call, skb, |
427 | !msg_data_left(msg) && !more, | 429 | !msg_data_left(msg) && !more, |
428 | notify_end_tx); | 430 | notify_end_tx); |
431 | /* Should check for failure here */ | ||
429 | skb = NULL; | 432 | skb = NULL; |
430 | } | 433 | } |
431 | } while (msg_data_left(msg) > 0); | 434 | } while (msg_data_left(msg) > 0); |