Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1596326

[PATCH 26/27] afs: Fix an off-by-one error in afs_send_pages()

From David Howells <dhowells@redhat.com>
Newsgroups linux.kernel
Subject [PATCH 26/27] afs: Fix an off-by-one error in afs_send_pages()
Date 2017-03-09 20:00 +0100
Message-ID <tjbs6-I0-19@gated-at.bofh.it> (permalink)
References <tjbs6-I0-7@gated-at.bofh.it>
Organization Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903

Show all headers | View raw


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>
---

 fs/afs/rxrpc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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)
 		 * packet as RxRPC might give us the reply before it
 		 * returns from sending the request.
 		 */
-		if (first + nr >= last)
+		if (first + nr - 1 >= last)
 			call->state = AFS_CALL_AWAIT_REPLY;
 		ret = rxrpc_kernel_send_data(afs_socket, call->rxcall,
 					     msg, bytes);

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 26/27] afs: Fix an off-by-one error in afs_send_pages() David Howells <dhowells@redhat.com> - 2017-03-09 20:00 +0100

csiph-web