From: Sam Lang Date: Tue, 29 Jan 2013 17:28:00 +0000 (-0600) Subject: mds: Send created ino in journaled_reply X-Git-Tag: v0.57~82^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=907c709ccb0a929411a1a86bfeab57974efb73da;p=ceph.git 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 --- diff --git a/src/mds/Server.cc b/src/mds/Server.cc index f8d1af1d11a0..2c6efaa1108b 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); }