diff options
author | David Howells <dhowells@redhat.com> | 2007-07-20 05:59:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-20 11:54:14 -0400 |
commit | bd6dc742a4b1945861795a66dc27c65365c5f28e (patch) | |
tree | bb075b1017c88ff27c1d8fba6fa805ecb0db0e62 /fs | |
parent | 5f7e08ca7b657f5678dd62a080f7f3a8f923ad02 (diff) |
AFS: Use patched rxrpc_kernel_send_data() correctly
Fix afs_send_simple_reply() to accept a greater-than-zero return value from
rxrpc_kernel_send_data() as being a successful return rather than thinking it
an error and aborting the call.
rxrpc_kernel_send_data() previously returned zero incorrectly when it worked
successfully, but has been patched to return the number of bytes it
transmitted.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/afs/rxrpc.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c index 1b36f45076ad..8ccee9ee1d9d 100644 --- a/fs/afs/rxrpc.c +++ b/fs/afs/rxrpc.c | |||
@@ -792,6 +792,7 @@ void afs_send_simple_reply(struct afs_call *call, const void *buf, size_t len) | |||
792 | { | 792 | { |
793 | struct msghdr msg; | 793 | struct msghdr msg; |
794 | struct iovec iov[1]; | 794 | struct iovec iov[1]; |
795 | int n; | ||
795 | 796 | ||
796 | _enter(""); | 797 | _enter(""); |
797 | 798 | ||
@@ -806,22 +807,20 @@ void afs_send_simple_reply(struct afs_call *call, const void *buf, size_t len) | |||
806 | msg.msg_flags = 0; | 807 | msg.msg_flags = 0; |
807 | 808 | ||
808 | call->state = AFS_CALL_AWAIT_ACK; | 809 | call->state = AFS_CALL_AWAIT_ACK; |
809 | switch (rxrpc_kernel_send_data(call->rxcall, &msg, len)) { | 810 | n = rxrpc_kernel_send_data(call->rxcall, &msg, len); |
810 | case 0: | 811 | if (n >= 0) { |
811 | _leave(" [replied]"); | 812 | _leave(" [replied]"); |
812 | return; | 813 | return; |
813 | 814 | } | |
814 | case -ENOMEM: | 815 | if (n == -ENOMEM) { |
815 | _debug("oom"); | 816 | _debug("oom"); |
816 | rxrpc_kernel_abort_call(call->rxcall, RX_USER_ABORT); | 817 | rxrpc_kernel_abort_call(call->rxcall, RX_USER_ABORT); |
817 | default: | ||
818 | rxrpc_kernel_end_call(call->rxcall); | ||
819 | call->rxcall = NULL; | ||
820 | call->type->destructor(call); | ||
821 | afs_free_call(call); | ||
822 | _leave(" [error]"); | ||
823 | return; | ||
824 | } | 818 | } |
819 | rxrpc_kernel_end_call(call->rxcall); | ||
820 | call->rxcall = NULL; | ||
821 | call->type->destructor(call); | ||
822 | afs_free_call(call); | ||
823 | _leave(" [error]"); | ||
825 | } | 824 | } |
826 | 825 | ||
827 | /* | 826 | /* |