]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix null snapflush logic
authorSage Weil <sage@newdream.net>
Wed, 18 Aug 2010 20:49:11 +0000 (13:49 -0700)
committerSage Weil <sage@newdream.net>
Wed, 18 Aug 2010 20:49:11 +0000 (13:49 -0700)
We only want to do a null snapflush if we _know_ there isn't another one
coming: that is, there aren't any outstanding issued excl/wr cap bits at
the client.  The old test has the bitwise NOT backwards.  We can also
limit the test to the bits we care about.

src/mds/Locker.cc

index 801f197a63648704ba0428c4338c018659303751..99bcf80105a160c705839abf8f5d9f309b341e5b 100644 (file)
@@ -1862,11 +1862,11 @@ void Locker::handle_client_caps(MClientCaps *m)
 
 
     // missing/skipped snapflush?
-    //  ** only if the client has completed all revocations.  if we
+    //  ** only if the client has completed all WR/EXCL revocations.  if we
     //     are still revoking, it's possible the client is waiting for
     //     data writeback and hasn't sent the flushsnap yet.  **
     if (head_in->client_need_snapflush.size()) {
-      if ((cap->pending() & ~cap->issued()) == 0) {
+      if ((cap->issued() & CEPH_CAP_ANY_WR & ~cap->pending()) == 0) {
        map<snapid_t, set<client_t> >::iterator p = head_in->client_need_snapflush.begin();
        while (p != head_in->client_need_snapflush.end()) {
          // p->first is the snap inode's ->last