* [PATCH] libceph: Fix ceph_tcp_sendpage()'s more boolean usage
@ 2015-06-25 16:56 Benoît Canet
2015-06-25 17:30 ` Ilya Dryomov
2015-06-25 20:28 ` Alex Elder
0 siblings, 2 replies; 3+ messages in thread
From: Benoît Canet @ 2015-06-25 16:56 UTC (permalink / raw)
To: ceph-devel; +Cc: idryomov, elder, Benoît Canet
Spotted while hunting http://tracker.ceph.com/issues/10905.
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,i
int offset, size_t size, bool more)
The logic is inverted: correct it.
Signed-off-by: Benoît Canet <benoit.canet@nodalink.com>
---
net/ceph/messenger.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index ec68cd3..eda06fd 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);
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] libceph: Fix ceph_tcp_sendpage()'s more boolean usage
2015-06-25 16:56 [PATCH] libceph: Fix ceph_tcp_sendpage()'s more boolean usage Benoît Canet
@ 2015-06-25 17:30 ` Ilya Dryomov
2015-06-25 20:28 ` Alex Elder
1 sibling, 0 replies; 3+ messages in thread
From: Ilya Dryomov @ 2015-06-25 17:30 UTC (permalink / raw)
To: Benoît Canet; +Cc: Ceph Development, Alex Elder
On Thu, Jun 25, 2015 at 7:56 PM, Benoît Canet <benoit.canet@nodalink.com> wrote:
> Spotted while hunting http://tracker.ceph.com/issues/10905.
>
> 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,i
> int offset, size_t size, bool more)
>
> The logic is inverted: correct it.
>
> Signed-off-by: Benoît Canet <benoit.canet@nodalink.com>
> ---
> net/ceph/messenger.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
> index ec68cd3..eda06fd 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);
Good catch. Applied.
Thanks,
Ilya
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] libceph: Fix ceph_tcp_sendpage()'s more boolean usage
2015-06-25 16:56 [PATCH] libceph: Fix ceph_tcp_sendpage()'s more boolean usage Benoît Canet
2015-06-25 17:30 ` Ilya Dryomov
@ 2015-06-25 20:28 ` Alex Elder
1 sibling, 0 replies; 3+ messages in thread
From: Alex Elder @ 2015-06-25 20:28 UTC (permalink / raw)
To: Benoît Canet, ceph-devel; +Cc: idryomov
On 06/25/2015 11:56 AM, Benoît Canet wrote:
> Spotted while hunting http://tracker.ceph.com/issues/10905.
>
> 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,i
> int offset, size_t size, bool more)
>
> The logic is inverted: correct it.
Whoops. I'm surprised we haven't had more trouble from this.
This should go to stable too.
Looks good.
Reviewed-by: Alex Elder <elder@linaro.org>
>
> Signed-off-by: Benoît Canet <benoit.canet@nodalink.com>
> ---
> net/ceph/messenger.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
> index ec68cd3..eda06fd 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);
>
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-06-25 20:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-25 16:56 [PATCH] libceph: Fix ceph_tcp_sendpage()'s more boolean usage Benoît Canet
2015-06-25 17:30 ` Ilya Dryomov
2015-06-25 20:28 ` Alex Elder
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.