]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: Remove got_safe from MetaRequest
authorSam Lang <sam.lang@inktank.com>
Mon, 25 Mar 2013 16:39:19 +0000 (11:39 -0500)
committerSam Lang <sam.lang@inktank.com>
Tue, 26 Mar 2013 14:25:18 +0000 (09:25 -0500)
Once a safe reply is received, we remove the
request from the mds_requests map, so checking that
it might be a duplicate won't succeed.  This patch
removes the got_safe checks in the reply handling code
and the got_safe field on the MetaRequest to avoid confusion.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
src/client/Client.cc
src/client/MetaRequest.cc
src/client/MetaRequest.h

index d1f8564aa8f6e5864b19b38f9068e21ad561e85f..f9e75f63c9b44193b56f1c9707ffe727634e3d87 100644 (file)
@@ -1700,8 +1700,7 @@ void Client::handle_client_reply(MClientReply *reply)
   MetaRequest *request = mds_requests[tid];
   assert(request);
     
-  if ((request->got_unsafe && !is_safe)
-      || (request->got_safe && is_safe)) {
+  if (request->got_unsafe && !is_safe) {
     //duplicate response
     ldout(cct, 0) << "got a duplicate reply on tid " << tid << " from mds "
            << mds_num << " safe:" << is_safe << dendl;
@@ -1752,7 +1751,6 @@ void Client::handle_client_reply(MClientReply *reply)
 
   if (is_safe) {
     // the filesystem change is committed to disk
-    request->got_safe = true;
     if (request->got_unsafe) {
       // we're done, clean up
       request->item.remove_myself();
index 199708c5de9c6434968f885b00cf213b53b644c7..b6935f970fbbbe530faa2539d78c447f572a602b 100644 (file)
@@ -35,7 +35,6 @@ void MetaRequest::dump(Formatter *f) const
   f->dump_unsigned("sent_on_mseq", sent_on_mseq);
   f->dump_int("retry_attempt", retry_attempt);
 
-  f->dump_int("got_safe", got_safe);
   f->dump_int("got_unsafe", got_unsafe);
 
   if (head.op == CEPH_MDS_OP_READDIR ||
index c167ec98f5b1cb1b6fbcb8d737a374b712da4455..465e88562fd9bb53bd5aa4a34d7c29d7bc6a1010 100644 (file)
@@ -63,7 +63,6 @@ public:
   string readdir_last_name;
 
   //possible responses
-  bool got_safe;
   bool got_unsafe;
 
   xlist<MetaRequest*>::item item;
@@ -90,7 +89,7 @@ public:
     ref(1), reply(0), 
     kick(false),
     readdir_offset(0), readdir_end(false), readdir_num(0),
-    got_safe(false), got_unsafe(false), item(this), unsafe_item(this),
+    got_unsafe(false), item(this), unsafe_item(this),
     lock("MetaRequest lock"),
     caller_cond(0), dispatch_cond(0),
     target(0) {