]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: set the proper extra bl for the create request 57754/head
authorXiubo Li <xiubli@redhat.com>
Tue, 28 May 2024 04:35:17 +0000 (12:35 +0800)
committerXiubo Li <xiubli@redhat.com>
Wed, 5 Jun 2024 01:17:59 +0000 (09:17 +0800)
Just in case a create request was totally completed but the client
didn't receive any unsafe and safe responses, and then when it's
retried in the MDS side it will be treated as a open request and
will miss setting the create ino for the reply message.

Finally for client it just sent a create request and then the MDS
just sent back a open reply, which will let the client miss setting
the CREATED flag and then the VFS will fail the create by returnning
a -EEXIST errno.

Fixes: https://tracker.ceph.com/issues/63265
Signed-off-by: Xiubo Li <xiubli@redhat.com>
src/mds/Server.cc

index 7efdd24bfb46a6b76b8e3e5b20501a697a7cd6e8..738f541cece61e468dfe72d51eca3f73545d20ac 100644 (file)
@@ -2790,10 +2790,18 @@ void Server::dispatch_client_request(const MDRequestRef& mdr)
 
     // funky.
   case CEPH_MDS_OP_CREATE:
-    if (mdr->has_completed)
+    if (mdr->has_completed) {
+      inodeno_t created;
+
+      ceph_assert(mdr->session);
+      mdr->session->have_completed_request(req->get_reqid().tid, &created);
+      ceph_assert(created != inodeno_t());
+
+      set_reply_extra_bl(req, created, mdr->reply_extra_bl);
       handle_client_open(mdr);  // already created.. just open
-    else
+    } else {
       handle_client_openc(mdr);
+    }
     break;
 
   case CEPH_MDS_OP_OPEN: