]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/Server: return after responding on error paths 69835/head
authorSun Yuechi <sunyuechi@iscas.ac.cn>
Tue, 30 Jun 2026 11:37:00 +0000 (19:37 +0800)
committerKefu Chai <k.chai@proxmox.com>
Wed, 1 Jul 2026 11:07:59 +0000 (19:07 +0800)
handle_client_symlink (-ENAMETOOLONG), reclaim_session (-EPERM) and
handle_client_readdir_snapdiff (-EINVAL) each sent an error reply on a
failure path but fell through, replying to the same MDRequest a second
time. reclaim_session additionally went on to bind reclaiming_from,
bypassing the auth_name check. Return right after sending the reply.

Fixes: https://tracker.ceph.com/issues/77862
Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn>
src/mds/Server.cc

index 688c21d336402cf464504fa10e6a0f5211e5815f..f345134ff327fb9fdad115e88dd269f235a5731b 100644 (file)
@@ -501,6 +501,7 @@ void Server::reclaim_session(Session *session, const cref_t<MClientReclaim> &m)
               << " != target auth_name " << target->info.auth_name << dendl;
       reply->set_result(-EPERM);
       mds->send_message_client(reply, session);
+      return;
     }
 
     ceph_assert(!target->reclaiming_from);
@@ -7700,6 +7701,7 @@ void Server::handle_client_symlink(const MDRequestRef& mdr)
   if (req->get_alternate_name().size() > alternate_name_max) {
     dout(10) << " alternate_name longer than " << alternate_name_max << dendl;
     respond_to_request(mdr, -ENAMETOOLONG);
+    return;
   }
   dn->set_alternate_name(req->get_alternate_name());
 
@@ -12111,6 +12113,7 @@ void Server::handle_client_readdir_snapdiff(const MDRequestRef& mdr)
       mdr->snapid_diff_other == CEPH_NOSNAP) {
     dout(10) << "reply to " << *req << " snapdiff -EINVAL" << dendl;
     respond_to_request(mdr, -EINVAL);
+    return;
   }
 
   unsigned max = req->head.args.snapdiff.max_entries;