Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Alex Markuze and committed by
Ilya Dryomov
e58103ca 1c439de7

+20
+20
fs/ceph/mds_client.c
··· 232 232 info->fscrypt_file_len, bad); 233 233 } 234 234 } 235 + 236 + /* 237 + * InodeStat encoding versions: 238 + * v1-v7: various fields added over time 239 + * v8: added optmetadata (versioned sub-structure containing 240 + * optional inode metadata like charmap for case-insensitive 241 + * filesystems). The kernel client doesn't support 242 + * case-insensitive lookups, so we skip this field. 243 + * v9: added subvolume_id (parsed below) 244 + */ 245 + if (struct_v >= 8) { 246 + u32 v8_struct_len; 247 + 248 + /* skip optmetadata versioned sub-structure */ 249 + ceph_decode_skip_8(p, end, bad); /* struct_v */ 250 + ceph_decode_skip_8(p, end, bad); /* struct_compat */ 251 + ceph_decode_32_safe(p, end, v8_struct_len, bad); 252 + ceph_decode_skip_n(p, end, v8_struct_len, bad); 253 + } 254 + 235 255 *p = end; 236 256 } else { 237 257 /* legacy (unversioned) struct */