From 7fe1785451cda3b6978f3c2ff012154132769a7e Mon Sep 17 00:00:00 2001
From: adilger <adilger>
Date: Tue, 9 Mar 2004 20:06:10 +0000
Subject: [PATCH] Delete obd_self_export from exp_obd_chain while we are
 disconnecting exports during a forced cleanup.  Otherwise, we will end up
 pointing to work_list, which is on the stack, and a list_del_init() on
 exp_obd_chain will end up stomping on some innocent variable on the stack,
 ending its already-short life just a bit too early. b=2908 r=robert

---
 lustre/ChangeLog         | 1 +
 lustre/obdclass/genops.c | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/lustre/ChangeLog b/lustre/ChangeLog
index f5107a5303..23f9ea5a8a 100644
--- a/lustre/ChangeLog
+++ b/lustre/ChangeLog
@@ -4,6 +4,7 @@ tbd  Cluster File Systems, Inc. <info@clusterfs.com>
 	- fixes for glimpse AST timeouts / incorrectly 0-sized files (2818)
 	- don't overwrite extent policy data in reply if lock was blocked (2901)
 	- drop filter export grants atomically with removal from device (2663)
+	- del obd_self_export from work_list in class_disconnect_exports (2908)
 
 2004-03-04  Cluster File Systems, Inc. <info@clusterfs.com>
        * version 1.2.0
diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c
index 5088abbc09..98ae3b5c7f 100644
--- a/lustre/obdclass/genops.c
+++ b/lustre/obdclass/genops.c
@@ -630,6 +630,9 @@ void class_disconnect_exports(struct obd_device *obd, int flags)
                         CDEBUG(D_HA,
                                "exp %p export uuid == obd uuid, don't discon\n",
                                exp);
+                        /* Need to delete this now so we don't end up pointing
+                         * to work_list later when this export is cleaned up. */
+                        list_del_init(&exp->exp_obd_chain);
                         class_export_put(exp);
                         continue;
                 }
-- 
GitLab