]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
ceph: handle InodeStat v8 versioned field in reply parsing
authorAlex Markuze <amarkuze@redhat.com>
Tue, 10 Feb 2026 09:06:24 +0000 (09:06 +0000)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 20 Apr 2026 14:43:57 +0000 (16:43 +0200)
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>
fs/ceph/mds_client.c

index 12d5c4bded4362bbffe8bb8bb4e29c8b7f8c5983..b2a07185cecd739d8894b36a233f68d3f440b421 100644 (file)
@@ -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 */