public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libceph: init the cursor when preparing the sparse read
@ 2024-02-29  4:19 xiubli
  2024-02-29  9:48 ` Luis Henriques
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: xiubli @ 2024-02-29  4:19 UTC (permalink / raw)
  To: ceph-devel
  Cc: idryomov, jlayton, vshankar, mchangir, Xiubo Li, stable,
	Luis Henriques

From: Xiubo Li <xiubli@redhat.com>

The osd code has remove cursor initilizing code and this will make
the sparse read state into a infinite loop. We should initialize
the cursor just before each sparse-read in messnger v2.

Cc: stable@vger.kernel.org
URL: https://tracker.ceph.com/issues/64607
Fixes: 8e46a2d068c9 ("libceph: just wait for more data to be available on the socket")
Reported-by: Luis Henriques <lhenriques@suse.de>
Signed-off-by: Xiubo Li <xiubli@redhat.com>
---
 net/ceph/messenger_v2.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/ceph/messenger_v2.c b/net/ceph/messenger_v2.c
index a0ca5414b333..7ae0f80100f4 100644
--- a/net/ceph/messenger_v2.c
+++ b/net/ceph/messenger_v2.c
@@ -2025,6 +2025,7 @@ static int prepare_sparse_read_cont(struct ceph_connection *con)
 static int prepare_sparse_read_data(struct ceph_connection *con)
 {
 	struct ceph_msg *msg = con->in_msg;
+	u64 len = con->in_msg->sparse_read_total ? : data_len(con->in_msg);
 
 	dout("%s: starting sparse read\n", __func__);
 
@@ -2034,6 +2035,8 @@ static int prepare_sparse_read_data(struct ceph_connection *con)
 	if (!con_secure(con))
 		con->in_data_crc = -1;
 
+	ceph_msg_data_cursor_init(&con->v2.in_cursor, con->in_msg, len);
+
 	reset_in_kvecs(con);
 	con->v2.in_state = IN_S_PREPARE_SPARSE_DATA_CONT;
 	con->v2.data_len_remain = data_len(msg);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-03-04 15:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-29  4:19 [PATCH] libceph: init the cursor when preparing the sparse read xiubli
2024-02-29  9:48 ` Luis Henriques
2024-02-29 10:48 ` Ilya Dryomov
2024-03-01  1:53   ` Xiubo Li
2024-03-01 17:15     ` Ilya Dryomov
2024-03-04  0:43       ` Xiubo Li
2024-03-04 11:12         ` Ilya Dryomov
2024-03-04 13:23           ` Xiubo Li
2024-03-01 16:16 ` Ilya Dryomov
2024-03-04  1:02   ` Xiubo Li
2024-03-04 11:02     ` Ilya Dryomov
     [not found]       ` <f54b8fb3-4343-4802-a495-51c5feed52b4@redhat.com>
2024-03-04 15:45         ` Ilya Dryomov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox