From 907c709ccb0a929411a1a86bfeab57974efb73da Mon Sep 17 00:00:00 2001 From: Sam Lang Date: Tue, 29 Jan 2013 11:28:00 -0600 Subject: [PATCH] mds: Send created ino in journaled_reply The MDS avoids sending an early reply if a request triggered inode allocation (no preallocated inodes yet). For create, this prevented the created ino from being sent back to the client, which is used to indicate creation (as apposed to already existing) of the file. This commit fixes the issue by adding the created ino to the journaled (safe) reply. Signed-off-by: Sam Lang --- src/mds/Server.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mds/Server.cc b/src/mds/Server.cc index f8d1af1d11a06..2c6efaa1108bd 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -2614,7 +2614,9 @@ public: mds->balancer->hit_inode(mdr->now, newi, META_POP_IWR); - mds->server->reply_request(mdr, 0); + MClientReply *reply = new MClientReply(mdr->client_request, 0); + reply->set_extra_bl(mdr->reply_extra_bl); + mds->server->reply_request(mdr, reply); } }; @@ -2765,6 +2767,7 @@ void Server::handle_client_openc(MDRequest *mdr) C_MDS_openc_finish *fin = new C_MDS_openc_finish(mds, mdr, dn, in, follows); if (mdr->client_request->get_connection()->has_feature(CEPH_FEATURE_REPLY_CREATE_INODE)) { + dout(10) << "adding ino to reply to indicate inode was created" << dendl; // add the file created flag onto the reply if create_flags features is supported ::encode(in->inode.ino, mdr->reply_extra_bl); } -- 2.39.5