Commit 5f0fc8ba authored by David Howells's avatar David Howells

afs: Only progress call state at end of Tx phase from rxrpc callback

Only progress the AFS call state at the end of Tx phase from the callback
passed to rxrpc_kernel_send_data() rather than setting it before the last
data send call.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent bf99a53c
...@@ -381,13 +381,6 @@ long afs_make_call(struct afs_addr_cursor *ac, struct afs_call *call, ...@@ -381,13 +381,6 @@ long afs_make_call(struct afs_addr_cursor *ac, struct afs_call *call,
msg.msg_controllen = 0; msg.msg_controllen = 0;
msg.msg_flags = MSG_WAITALL | (call->send_pages ? MSG_MORE : 0); msg.msg_flags = MSG_WAITALL | (call->send_pages ? MSG_MORE : 0);
/* We have to change the state *before* sending the last packet as
* rxrpc might give us the reply before it returns from sending the
* request. Further, if the send fails, we may already have been given
* a notification and may have collected it.
*/
if (!call->send_pages)
call->state = AFS_CALL_AWAIT_REPLY;
ret = rxrpc_kernel_send_data(call->net->socket, rxcall, ret = rxrpc_kernel_send_data(call->net->socket, rxcall,
&msg, call->request_size, &msg, call->request_size,
afs_notify_end_request_tx); afs_notify_end_request_tx);
...@@ -799,7 +792,6 @@ void afs_send_empty_reply(struct afs_call *call) ...@@ -799,7 +792,6 @@ void afs_send_empty_reply(struct afs_call *call)
msg.msg_controllen = 0; msg.msg_controllen = 0;
msg.msg_flags = 0; msg.msg_flags = 0;
call->state = AFS_CALL_AWAIT_ACK;
switch (rxrpc_kernel_send_data(net->socket, call->rxcall, &msg, 0, switch (rxrpc_kernel_send_data(net->socket, call->rxcall, &msg, 0,
afs_notify_end_reply_tx)) { afs_notify_end_reply_tx)) {
case 0: case 0:
...@@ -839,7 +831,6 @@ void afs_send_simple_reply(struct afs_call *call, const void *buf, size_t len) ...@@ -839,7 +831,6 @@ void afs_send_simple_reply(struct afs_call *call, const void *buf, size_t len)
msg.msg_controllen = 0; msg.msg_controllen = 0;
msg.msg_flags = 0; msg.msg_flags = 0;
call->state = AFS_CALL_AWAIT_ACK;
n = rxrpc_kernel_send_data(net->socket, call->rxcall, &msg, len, n = rxrpc_kernel_send_data(net->socket, call->rxcall, &msg, len,
afs_notify_end_reply_tx); afs_notify_end_reply_tx);
if (n >= 0) { if (n >= 0) {
......
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