]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.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)
committerxiubli <xiubli@localhost.localdomain>
Wed, 5 Jun 2024 00:44:12 +0000 (08:44 +0800)
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>
src/mds/Server.cc

index bda51023c7aa694669707edf08eaee056ae97b75..7efdd24bfb46a6b76b8e3e5b20501a697a7cd6e8 100644 (file)
@@ -2574,7 +2574,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);