]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: initialize CInode::loner_cap when twiddling filelock states after reconnect
authorSage Weil <sage@newdream.net>
Wed, 26 Nov 2008 17:58:32 +0000 (09:58 -0800)
committerSage Weil <sage@newdream.net>
Wed, 26 Nov 2008 18:37:18 +0000 (10:37 -0800)
loner_cap must either be defined or not defined to match the lock states.

src/mds/MDCache.cc

index 7ceec8ea470c63eec47c663efc1b20ac79d60a17..46050e48dc724692751d1c1600e8cc9907420392 100644 (file)
@@ -3500,8 +3500,10 @@ void MDCache::process_reconnected_caps()
     if (in->is_auth()) {
       // wr?
       if (issued & (CEPH_CAP_WR|CEPH_CAP_WRBUFFER)) {
+       in->loner_cap = -1;
        if (issued & (CEPH_CAP_RDCACHE|CEPH_CAP_WRBUFFER)) {
          in->filelock.set_state(LOCK_LONER);
+         in->choose_loner();
        } else {
          in->filelock.set_state(LOCK_MIXED);
        }
@@ -3509,6 +3511,7 @@ void MDCache::process_reconnected_caps()
     } else {
       // note that client should perform stale/reap cleanup during reconnect.
       assert((issued & (CEPH_CAP_WR|CEPH_CAP_WRBUFFER)) == 0);   // ????
+      in->loner_cap = -1;
       if (in->filelock.is_xlocked())
        in->filelock.set_state(LOCK_LOCK);
       else