From fc0e7a5ef960f0b2aa9db2caaa89bd9d033ef2d8 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 4 Jun 2008 09:41:41 -0700 Subject: [PATCH] mds: fix FileLock handling of loner vs lock on replicas --- src/mds/Locker.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index ca0787a86c7..4b6a33cad2f 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -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); -- 2.47.3