]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/flock: properly update ceph_lock_state_t::client_waiting_lock_counts
authorYan, Zheng <zyan@redhat.com>
Sat, 3 Jun 2017 04:01:27 +0000 (12:01 +0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Mon, 10 Jul 2017 20:57:53 +0000 (13:57 -0700)
no item is added to waiting_locks when deadlock check fails

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
(cherry picked from commit a6b01939a199833568961ae4d30d8540a25a7740)

src/mds/flock.cc

index 09557032e07fd1f6f1daa2df3552f0ac0dd3f7b8..a535f213dae5781fc9d59a86ded410d3f10d0ef0 100644 (file)
@@ -141,6 +141,7 @@ bool ceph_lock_state_t::is_deadlock(const ceph_filelock& fl,
 void ceph_lock_state_t::add_waiting(const ceph_filelock& fl)
 {
   waiting_locks.insert(pair<uint64_t, ceph_filelock>(fl.start, fl));
+  ++client_waiting_lock_counts[(client_t)fl.client];
   if (type == CEPH_LOCK_FCNTL) {
     global_waiting_locks.insert(pair<ceph_filelock,ceph_lock_state_t*>(fl, this));
   }
@@ -200,8 +201,6 @@ bool ceph_lock_state_t::add_lock(ceph_filelock& new_lock,
   if (ret) {
     ++client_held_lock_counts[(client_t)new_lock.client];
   }
-  else if (wait_on_fail && !replay)
-    ++client_waiting_lock_counts[(client_t)new_lock.client];
   return ret;
 }