ceph: skip the memories when received a higher version of message
PATCH v3 1/1 ceph: skip the memories when received a higher version of message
From: Xiubo Li <[email protected]>
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
--- fs/ceph/mds_client.c | 3 +++ 1 file changed, 3 insertions(+)
fs/ceph/mds_client.c +3 -0
@@ -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 ;
Signature · 1 line
2.27.0
Quoted 32 lines · On Tue, 2022-03-01 at 22:39 +0800, [email protected] wrote:
From: Xiubo Li <[email protected]>
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 <[email protected]>--- fs/ceph/mds_client.c | 3 +++ 1 file changed, 3 insertions(+)fs/ceph/mds_client.c +2
-0@@ -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);
fs/ceph/mds_client.c static int parse_reply_info_lease(void **p, void *end, · line 355
Quoted 7 lines
fs/ceph/mds_client.c +1
-0@@ -347,6 +349,7 @@ static int parse_reply_info_lease(void **p, void *end, *altname_len =0 ; } } + *p = lend;return 0 ; bad:return -EIO ;
Feel free to fold this into the appropriate patch in wip-fscrypt if you like...
Quoted 43 lines · Jeff Layton
Quoted 32 lines · On Tue, 2022-03-01 at 22:39 +0800, [email protected] wrote:
From: Xiubo Li <[email protected]>
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 <[email protected]>--- fs/ceph/mds_client.c | 3 +++ 1 file changed, 3 insertions(+)fs/ceph/mds_client.c +2
-0@@ -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);fs/ceph/mds_client.c static int parse_reply_info_lease(void **p, void *end, · line 355
Quoted 7 lines
fs/ceph/mds_client.c +1
-0@@ -347,6 +349,7 @@ static int parse_reply_info_lease(void **p, void *end, *altname_len =0 ; } } + *p = lend;return 0 ; bad:return -EIO ;Feel free to fold this into the appropriate patch in wip-fscrypt if you like...
Quoted 2 lines
Reviewed-by Jeff Layton <[email protected]>
Sure.
Quoted 43 lines · Jeff Layton
Quoted 32 lines · On Tue, 2022-03-01 at 22:39 +0800, [email protected] wrote:
From: Xiubo Li <[email protected]>
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 <[email protected]>--- fs/ceph/mds_client.c | 3 +++ 1 file changed, 3 insertions(+)fs/ceph/mds_client.c +2
-0@@ -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);fs/ceph/mds_client.c static int parse_reply_info_lease(void **p, void *end, · line 355
Quoted 7 lines
fs/ceph/mds_client.c +1
-0@@ -347,6 +349,7 @@ static int parse_reply_info_lease(void **p, void *end, *altname_len =0 ; } } + *p = lend;return 0 ; bad:return -EIO ;Feel free to fold this into the appropriate patch in wip-fscrypt if you like...
Quoted 1 line
Reviewed-by Jeff Layton <[email protected]>
Hi Jeff,
Done and I also have rebased wip-fscrypt branch to the testing branch. Since I need some patches from testing branch to continue my another snapshot related patch series.
- Xiubo