diff mbox series

[v3] ceph: skip the memories when received a higher version of message

Message ID 20220301143927.513492-1-xiubli@redhat.com
State New
Headers show
Series [v3] ceph: skip the memories when received a higher version of message | expand

Commit Message

Xiubo Li March 1, 2022, 2:39 p.m. UTC
From: Xiubo Li <xiubli@redhat.com>

We should skip the extra memories which are from the higher version
just likes the libcephfs client does.

URL: https://tracker.ceph.com/issues/54430
Signed-off-by: Xiubo Li <xiubli@redhat.com>
---
 fs/ceph/mds_client.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 94b4c6508044..608d077f2eeb 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -313,6 +313,7 @@  static int parse_reply_info_lease(void **p, void *end,
 {
 	u8 struct_v;
 	u32 struct_len;
+	void *lend;
 
 	if (features == (u64)-1) {
 		u8 struct_compat;
@@ -332,6 +333,7 @@  static int parse_reply_info_lease(void **p, void *end,
 		*altname = NULL;
 	}
 
+	lend = *p + struct_len;
 	ceph_decode_need(p, end, struct_len, bad);
 	*lease = *p;
 	*p += sizeof(**lease);
@@ -347,6 +349,7 @@  static int parse_reply_info_lease(void **p, void *end,
 			*altname_len = 0;
 		}
 	}
+	*p = lend;
 	return 0;
 bad:
 	return -EIO;