linux-stable/include/linux/ceph
Xiubo Li 8e46a2d068 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: d396f89db3 ("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>
2024-02-07 14:43:29 +01:00
..
auth.h libceph: set global_id as soon as we get an auth ticket 2021-06-24 21:03:17 +02:00
buffer.h
ceph_debug.h libceph: add doutc and *_client debug macros support 2023-11-03 23:28:33 +01:00
ceph_features.h libceph, ceph: get and handle cluster maps with addrvecs 2020-12-14 23:21:50 +01:00
ceph_frag.h
ceph_fs.h ceph: handle idmapped mounts in create_request_message() 2023-11-03 23:28:33 +01:00
ceph_hash.h
cls_lock_client.h
debugfs.h libceph: drop CEPH_DEFINE_SHOW_FUNC 2020-03-30 12:42:40 +02:00
decode.h libceph, ceph: implement msgr2.1 protocol (crc and secure modes) 2020-12-14 23:21:50 +01:00
libceph.h ceph: move mount state enum to super.h 2023-02-02 13:40:23 +01:00
messenger.h libceph: just wait for more data to be available on the socket 2024-02-07 14:43:29 +01:00
mon_client.h ceph: Annotate struct ceph_monmap with __counted_by 2023-09-18 10:39:29 +01:00
msgpool.h
msgr.h libceph: add __maybe_unused to DEFINE_MSGR2_FEATURE 2020-12-28 20:34:33 +01:00
osd_client.h libceph: fail sparse-read if the data length doesn't match 2024-02-07 14:43:29 +01:00
osdmap.h libceph, ceph: get and handle cluster maps with addrvecs 2020-12-14 23:21:50 +01:00
pagelist.h
rados.h libceph: add CEPH_OSD_OP_ASSERT_VER support 2023-08-24 11:24:35 +02:00
string_table.h
striper.h
types.h