]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix FileLock handling of loner vs lock on replicas
authorSage Weil <sage@newdream.net>
Wed, 4 Jun 2008 16:41:41 +0000 (09:41 -0700)
committerSage Weil <sage@newdream.net>
Wed, 4 Jun 2008 16:41:41 +0000 (09:41 -0700)
src/mds/Locker.cc

index ca0787a86c7ae9d6515dbde477a0892cbc44163a..4b6a33cad2fdb9ca5131fb883b13bc160f4493cc 100644 (file)
@@ -3381,8 +3381,10 @@ bool Locker::file_sync(FileLock *lock)
       bufferlist softdata;
       lock->encode_locked_state(softdata);
       send_lock_message(lock, LOCK_AC_SYNC, softdata);
-      lock->init_gather();
-      gather++;
+      if (lock->get_state() != LOCK_GSYNCL) {    // loner replica is already LOCK
+       lock->init_gather();
+       gather++;
+      }
     }
     int issued = in->get_caps_issued();
     if (issued & ~lock->caps_allowed()) {
@@ -3488,8 +3490,10 @@ void Locker::file_mixed(FileLock *lock)
     int gather = 0;
     if (in->is_replicated()) {
       send_lock_message(lock, LOCK_AC_MIXED);
-      lock->init_gather();
-      gather++;
+      if (lock->get_state() != LOCK_GMIXEDL) {  // LONER replica is LOCK
+       lock->init_gather();
+       gather++;
+      }
     }
     if (lock->get_num_client_lease()) {
       revoke_client_leases(lock);