mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
ceph: handle InodeStat v8 versioned field in reply parsing
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 <amarkuze@redhat.com> Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
parent
1c439de70b
commit
e58103caff
|
|
@ -232,6 +232,26 @@ static int parse_reply_info_in(void **p, void *end,
|
|||
info->fscrypt_file_len, bad);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* InodeStat encoding versions:
|
||||
* v1-v7: various fields added over time
|
||||
* v8: added optmetadata (versioned sub-structure containing
|
||||
* optional inode metadata like charmap for case-insensitive
|
||||
* filesystems). The kernel client doesn't support
|
||||
* case-insensitive lookups, so we skip this field.
|
||||
* v9: added subvolume_id (parsed below)
|
||||
*/
|
||||
if (struct_v >= 8) {
|
||||
u32 v8_struct_len;
|
||||
|
||||
/* skip optmetadata versioned sub-structure */
|
||||
ceph_decode_skip_8(p, end, bad); /* struct_v */
|
||||
ceph_decode_skip_8(p, end, bad); /* struct_compat */
|
||||
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 */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user