Whamcloud - gitweb
LU-6852 ldlm: Do not evict MDS-MDS connection 24/13224/45
authorwang di <di.wang@intel.com>
Tue, 6 Oct 2015 18:36:43 +0000 (14:36 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 15 Oct 2015 15:58:08 +0000 (15:58 +0000)
Do not put the MDT-MDT lock in the waiting lock list, so
it will evict MDTs due to the lock timeout between MDTs,
which can help the updates replay being finished finally,
so the DNE filesystem will be in consistent state after
recovery.

If for some reasons, the filesystem will hang there because
of these two changes, then the administrator should step in
and inactivate the MDT manually and run lfsck.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: I83e7f8f55ee15730ed2d9826d08a398ddd72792a
Reviewed-on: http://review.whamcloud.com/13224
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ldlm/ldlm_lockd.c

index 34c210b..760feb5 100644 (file)
@@ -444,6 +444,12 @@ static int ldlm_add_waiting_lock(struct ldlm_lock *lock)
        LASSERT(ldlm_is_res_locked(lock));
        LASSERT(!ldlm_is_cancel_on_block(lock));
 
+       /* Do not put cross-MDT lock in the waiting list, since we
+        * will not evict it due to timeout for now */
+       if (lock->l_export != NULL &&
+           (exp_connect_flags(lock->l_export) & OBD_CONNECT_MDS_MDS))
+               return 0;
+
        spin_lock_bh(&waiting_locks_spinlock);
        if (ldlm_is_cancel(lock)) {
                spin_unlock_bh(&waiting_locks_spinlock);
@@ -559,6 +565,12 @@ int ldlm_refresh_waiting_lock(struct ldlm_lock *lock, int timeout)
                return 0;
        }
 
+       if (exp_connect_flags(lock->l_export) & OBD_CONNECT_MDS_MDS) {
+               /* We don't have a "waiting locks list" on OSP. */
+               LDLM_DEBUG(lock, "MDS-MDS lock: no-op");
+               return 0;
+       }
+
        spin_lock_bh(&waiting_locks_spinlock);
 
        if (list_empty(&lock->l_pending_chain)) {