From 0df12b142ce917fd8395d4837f15bd473e60872f Mon Sep 17 00:00:00 2001
From: johann <johann>
Date: Tue, 7 Oct 2008 15:07:06 +0000
Subject: [PATCH] Branch b1_6 b=17026 i=shadow i=oleg

Description: (ptllnd_peer.c:557:kptllnd_peer_check_sends()) ASSERTION(!in_interrupt()) failed
Details: fix stack overflow in the distributed lock manager by defering export
         eviction after a failed ast to the elt thread instead of handling
         it in the dlm interpret routine.
---
 lustre/ChangeLog         | 7 +++++++
 lustre/ldlm/ldlm_lockd.c | 7 +++++++
 lustre/mds/mds_reint.c   | 3 ++-
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/lustre/ChangeLog b/lustre/ChangeLog
index 7e06d24f65..a0bd3d0231 100644
--- a/lustre/ChangeLog
+++ b/lustre/ChangeLog
@@ -144,6 +144,13 @@ Bugzilla   : 14095
 Description: Add lustre_start utility to start or stop multiple Lustre servers
              from a CSV file.
 
+Severity   : normal
+Bugzilla   : 17026
+Description: (ptllnd_peer.c:557:kptllnd_peer_check_sends()) ASSERTION(!in_interrupt()) failed
+Details    : fix stack overflow in the distributed lock manager by defering export
+	     eviction after a failed ast to the elt thread instead of handling
+	     it in the dlm interpret routine.
+
 --------------------------------------------------------------------------
 
 2008-08-31 Sun Microsystems, Inc.
diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c
index 7dfbbd1a2c..a6cc1a2309 100644
--- a/lustre/ldlm/ldlm_lockd.c
+++ b/lustre/ldlm/ldlm_lockd.c
@@ -465,7 +465,14 @@ static void ldlm_failed_ast(struct ldlm_lock *lock, int rc,
 
         if (obd_dump_on_timeout)
                 libcfs_debug_dumplog();
+#ifdef __KERNEL__
+        spin_lock_bh(&waiting_locks_spinlock);
+        list_add(&lock->l_pending_chain, &expired_lock_thread.elt_expired_locks);
+        cfs_waitq_signal(&expired_lock_thread.elt_waitq);
+        spin_unlock_bh(&waiting_locks_spinlock);
+#else
         class_fail_export(lock->l_export);
+#endif
 }
 
 static int ldlm_handle_ast_error(struct ldlm_lock *lock,
diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c
index 2dc03816b9..ab8330d899 100644
--- a/lustre/mds/mds_reint.c
+++ b/lustre/mds/mds_reint.c
@@ -2393,7 +2393,8 @@ no_unlink:
 
         GOTO(cleanup, rc);
 cleanup:
-        rc = mds_finish_transno(mds, de_tgtdir ? de_tgtdir->d_inode : NULL,
+        rc = mds_finish_transno(mds, de_tgtdir && !IS_ERR(de_tgtdir) ?
+                                                      de_tgtdir->d_inode : NULL,
                                 handle, req, rc, 0, 0);
 
         switch (cleanup_phase) {
-- 
GitLab