Add forward-compatible handling for the new versioned field introduced in InodeStat v8. This patch only skips the field without using it, preparing for future protocol extensions. The v8 encoding adds a versioned sub-structure that needs to be properly decoded and skipped to maintain compatibility with newer MDS versions. Signed-off-by: Alex Markuze --- fs/ceph/mds_client.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 1740047aef0f..32561fc701e5 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -231,6 +231,18 @@ static int parse_reply_info_in(void **p, void *end, info->fscrypt_file_len, bad); } } + + /* struct_v 8 added a versioned field - skip it */ + if (struct_v >= 8) { + u8 v8_struct_v, v8_struct_compat; + u32 v8_struct_len; + + ceph_decode_8_safe(p, end, v8_struct_v, bad); + ceph_decode_8_safe(p, end, v8_struct_compat, bad); + ceph_decode_32_safe(p, end, v8_struct_len, bad); + ceph_decode_skip_n(p, end, v8_struct_len, bad); + } + *p = end; } else { /* legacy (unversioned) struct */ -- 2.34.1