aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/ceph/messenger.h
diff options
context:
space:
mode:
authorXiubo Li <xiubli@redhat.com>2023-12-14 16:01:03 +0800
committerIlya Dryomov <idryomov@gmail.com>2024-02-07 14:43:29 +0100
commit8e46a2d068c92a905d01cbb018b00d66991585ab (patch)
treef867b81e8250c9340027f9d5dc265ed49d4eca7c /include/linux/ceph/messenger.h
parentlibceph: rename read_sparse_msg_*() to read_partial_sparse_msg_*() (diff)
downloadwireguard-linux-8e46a2d068c92a905d01cbb018b00d66991585ab.tar.xz
wireguard-linux-8e46a2d068c92a905d01cbb018b00d66991585ab.zip
libceph: just wait for more data to be available on the socket
A short read may occur while reading the message footer from the socket. Later, when the socket is ready for another read, the messenger invokes all read_partial_*() handlers, including read_partial_sparse_msg_data(). The expectation is that read_partial_sparse_msg_data() would bail, allowing the messenger to invoke read_partial() for the footer and pick up where it left off. However read_partial_sparse_msg_data() violates that and ends up calling into the state machine in the OSD client. The sparse-read state machine assumes that it's a new op and interprets some piece of the footer as the sparse-read header and returns bogus extents/data length, etc. To determine whether read_partial_sparse_msg_data() should bail, let's reuse cursor->total_resid. Because once it reaches to zero that means all the extents and data have been successfully received in last read, else it could break out when partially reading any of the extents and data. And then osd_sparse_read() could continue where it left off. [ idryomov: changelog ] Link: https://tracker.ceph.com/issues/63586 Fixes: d396f89db39a ("libceph: add sparse read support to msgr1") Signed-off-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'include/linux/ceph/messenger.h')
-rw-r--r--include/linux/ceph/messenger.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index 2eaaabbe98cb..1717cc57cdac 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -283,7 +283,7 @@ struct ceph_msg {
struct kref kref;
bool more_to_follow;
bool needs_out_seq;
- bool sparse_read;
+ u64 sparse_read_total;
int front_alloc_len;
struct ceph_msgpool *pool;