summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorXiubo Li <xiubli@redhat.com>2023-10-13 13:55:44 +0800
committerIlya Dryomov <idryomov@gmail.com>2024-02-07 14:43:29 +0100
commitcd7d469c25704d414d71bf3644f163fb74e7996b (patch)
tree3a5e04cf308920fb9c8fd90c49183e9c1fad4545 /include/linux
parent54be6c6c5ae8e0d93a6c4641cb7528eb0b6ba478 (diff)
libceph: fail sparse-read if the data length doesn't match
Once this happens that means there have bugs. 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')
-rw-r--r--include/linux/ceph/osd_client.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index fa018d5864e7..f66f6aac74f6 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -45,6 +45,7 @@ enum ceph_sparse_read_state {
CEPH_SPARSE_READ_HDR = 0,
CEPH_SPARSE_READ_EXTENTS,
CEPH_SPARSE_READ_DATA_LEN,
+ CEPH_SPARSE_READ_DATA_PRE,
CEPH_SPARSE_READ_DATA,
};
@@ -64,7 +65,7 @@ struct ceph_sparse_read {
u64 sr_req_len; /* orig request length */
u64 sr_pos; /* current pos in buffer */
int sr_index; /* current extent index */
- __le32 sr_datalen; /* length of actual data */
+ u32 sr_datalen; /* length of actual data */
u32 sr_count; /* extent count in reply */
int sr_ext_len; /* length of extent array */
struct ceph_sparse_extent *sr_extent; /* extent array */