Skip to content

Commit

Permalink
libceph: rename read_sparse_msg_*() to read_partial_sparse_msg_*()
Browse files Browse the repository at this point in the history
[ Upstream commit ee97302 ]

These functions are supposed to behave like other read_partial_*()
handlers: the contract with messenger v1 is that the handler bails if
the area of the message it's responsible for is already processed.
This comes up when handling short reads from the socket.

[ idryomov: changelog ]

Signed-off-by: Xiubo Li <xiubli@redhat.com>
Acked-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Stable-dep-of: 8e46a2d ("libceph: just wait for more data to be available on the socket")
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
lxbsz authored and gregkh committed Feb 16, 2024
1 parent d3607ac commit e6140f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/ceph/messenger_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ static inline int read_partial_message_section(struct ceph_connection *con,
return read_partial_message_chunk(con, section, sec_len, crc);
}

static int read_sparse_msg_extent(struct ceph_connection *con, u32 *crc)
static int read_partial_sparse_msg_extent(struct ceph_connection *con, u32 *crc)
{
struct ceph_msg_data_cursor *cursor = &con->in_msg->cursor;
bool do_bounce = ceph_test_opt(from_msgr(con->msgr), RXBOUNCE);
Expand Down Expand Up @@ -1026,7 +1026,7 @@ static int read_sparse_msg_extent(struct ceph_connection *con, u32 *crc)
return 1;
}

static int read_sparse_msg_data(struct ceph_connection *con)
static int read_partial_sparse_msg_data(struct ceph_connection *con)
{
struct ceph_msg_data_cursor *cursor = &con->in_msg->cursor;
bool do_datacrc = !ceph_test_opt(from_msgr(con->msgr), NOCRC);
Expand All @@ -1043,7 +1043,7 @@ static int read_sparse_msg_data(struct ceph_connection *con)
con->v1.in_sr_len,
&crc);
else if (cursor->sr_resid > 0)
ret = read_sparse_msg_extent(con, &crc);
ret = read_partial_sparse_msg_extent(con, &crc);

if (ret <= 0) {
if (do_datacrc)
Expand Down Expand Up @@ -1254,7 +1254,7 @@ static int read_partial_message(struct ceph_connection *con)
return -EIO;

if (m->sparse_read)
ret = read_sparse_msg_data(con);
ret = read_partial_sparse_msg_data(con);
else if (ceph_test_opt(from_msgr(con->msgr), RXBOUNCE))
ret = read_partial_msg_data_bounce(con);
else
Expand Down

0 comments on commit e6140f2

Please sign in to comment.