]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: encode the correct extra info depending on the feature bits
authorXiubo Li <xiubli@redhat.com>
Tue, 28 May 2024 04:23:57 +0000 (12:23 +0800)
committerJos Collin <jcollin@redhat.com>
Thu, 11 Jul 2024 01:36:26 +0000 (07:06 +0530)
In the client side it will decode the extra info depending on the
feature bits, but if we always encode it with the old version then
the client could crash or gets the corrupted data. More detail
please see "parse_reply_info_create()" in kclient code.

Fixes: https://tracker.ceph.com/issues/63265
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit 1f1198b81b2442e5d6c0566bdade2f5d7dd23d12)

src/mds/Server.cc

index d5e1478607e80260896e81b595cc66c4db0041ea..c89dffd1c2379c048bafb570919a30432c8fd1c2 100644 (file)
@@ -2562,7 +2562,7 @@ void Server::handle_client_request(const cref_t<MClientRequest> &req)
         auto reply = make_message<MClientReply>(*req, 0);
        if (created != inodeno_t()) {
          bufferlist extra;
-         encode(created, extra);
+         set_reply_extra_bl(req, created, extra);
          reply->set_extra_bl(extra);
        }
         mds->send_message_client(reply, session);