From: Benoît Canet Date: Thu, 25 Jun 2015 17:32:34 +0000 (+0300) Subject: libceph: Fix ceph_tcp_sendpage()'s more boolean usage X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c2cfa19400979dc1a14bba75f83b451b0cd9507a;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git libceph: Fix ceph_tcp_sendpage()'s more boolean usage From struct ceph_msg_data_cursor in include/linux/ceph/messenger.h: bool last_piece; /* current is last piece */ In ceph_msg_data_next(): *last_piece = cursor->last_piece; A call to ceph_msg_data_next() is followed by: ret = ceph_tcp_sendpage(con->sock, page, page_offset, length, last_piece); while ceph_tcp_sendpage() is: static int ceph_tcp_sendpage(struct socket *sock, struct page *page, int offset, size_t size, bool more) The logic is inverted: correct it. Signed-off-by: Benoît Canet Reviewed-by: Alex Elder Signed-off-by: Ilya Dryomov --- diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 38f06a4c3c9e..1441aeff8bd7 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -1544,7 +1544,7 @@ static int write_partial_message_data(struct ceph_connection *con) page = ceph_msg_data_next(&msg->cursor, &page_offset, &length, &last_piece); ret = ceph_tcp_sendpage(con->sock, page, page_offset, - length, last_piece); + length, !last_piece); if (ret <= 0) { if (do_datacrc) msg->footer.data_crc = cpu_to_le32(crc);