]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: Send created ino in journaled_reply
authorSam Lang <sam.lang@inktank.com>
Tue, 29 Jan 2013 17:28:00 +0000 (11:28 -0600)
committerSam Lang <sam.lang@inktank.com>
Tue, 29 Jan 2013 17:28:00 +0000 (11:28 -0600)
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 <sam.lang@inktank.com>
src/mds/Server.cc

index f8d1af1d11a069187cfa3b902f9fda6f8dec20dd..2c6efaa1108bd14f018c5e96b1cbd4ac91662c30 100644 (file)
@@ -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);
   }