]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: make two passes on scatter_nudge
authorSage Weil <sage@newdream.net>
Wed, 27 Jul 2011 19:42:21 +0000 (12:42 -0700)
committerSage Weil <sage@newdream.net>
Wed, 27 Jul 2011 19:42:21 +0000 (12:42 -0700)
It's possible for scatter_nudge on a scatterlock in LOCK with dirty set to
go to MIX immediately and remain stable.  Give two 'nudge' passes before
we stop to avoid looping.

This fixes an assert failure where a nudge from log trimming ended up in a
stable state and asserted (!c).  The second pass will go trigger the dirty
writebehind.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mds/Locker.cc

index 2f4cdc8af5ef32186e0107b8bc11e8c838f7ac3f..6d1374ea39bae874c8601ae352c25831228cd05e 100644 (file)
@@ -3616,6 +3616,7 @@ void Locker::scatter_nudge(ScatterLock *lock, Context *c, bool forcelockchange)
   }
 
   if (p->is_auth()) {
+    int count = 0;
     while (true) {
       if (lock->is_stable()) {
        // can we do it now?
@@ -3659,8 +3660,9 @@ void Locker::scatter_nudge(ScatterLock *lock, Context *c, bool forcelockchange)
        default:
          assert(0);
        }
-       if (lock->is_stable()) {
-         dout(10) << "scatter_nudge oh, stable again already." << dendl;
+       ++count;
+       if (lock->is_stable() && count == 2) {
+         dout(10) << "scatter_nudge oh, stable after two cycles." << dendl;
          // this should only realy happen when called via
          // handle_file_lock due to AC_NUDGE, because the rest of the
          // time we are replicated or have dirty data and won't get