diff options
author | David Howells <dhowells@redhat.com> | 2017-03-16 12:27:48 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2017-03-16 12:29:30 -0400 |
commit | 445783d0ec173a52bef2e9b129de7d716a19b9fa (patch) | |
tree | daacf4666380115025fd3f6168d43de834d43b2b | |
parent | 7286a35e893176169b09715096a4aca557e2ccd2 (diff) |
afs: Fix an off-by-one error in afs_send_pages()
afs_send_pages() should only put the call into the AFS_CALL_AWAIT_REPLY
state if it has sent all the pages - but the check it makes is incorrect
and sometimes it will finish the loop early.
Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r-- | fs/afs/rxrpc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c index 22d26b369070..b12da6aa5412 100644 --- a/fs/afs/rxrpc.c +++ b/fs/afs/rxrpc.c | |||
@@ -315,7 +315,7 @@ static int afs_send_pages(struct afs_call *call, struct msghdr *msg) | |||
315 | * packet as RxRPC might give us the reply before it | 315 | * packet as RxRPC might give us the reply before it |
316 | * returns from sending the request. | 316 | * returns from sending the request. |
317 | */ | 317 | */ |
318 | if (first + nr >= last) | 318 | if (first + nr - 1 >= last) |
319 | call->state = AFS_CALL_AWAIT_REPLY; | 319 | call->state = AFS_CALL_AWAIT_REPLY; |
320 | ret = rxrpc_kernel_send_data(afs_socket, call->rxcall, | 320 | ret = rxrpc_kernel_send_data(afs_socket, call->rxcall, |
321 | msg, bytes); | 321 | msg, bytes); |