From: Xiubo Li Date: Tue, 28 May 2024 04:35:17 +0000 (+0800) Subject: mds: set the proper extra bl for the create request X-Git-Tag: testing/wip-jcollin-testing-20240711.095637-squid~9^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8fe0489db3e749d07b4898d80afa9b33e0f583e5;p=ceph-ci.git mds: set the proper extra bl for the create request 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 (cherry picked from commit 3482100e8ce174d2fd3a2e7f7ed0333ae2c0a166) --- diff --git a/src/mds/Server.cc b/src/mds/Server.cc index c89dffd1c23..17a409d89f1 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -2783,10 +2783,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: