@@ -1701,6 +1701,21 @@ int class_add_nids_to_uuid(struct obd_uuid *uuid, lnet_nid_t *nids,
int class_procfs_init(void);
int class_procfs_clean(void);
+extern unsigned int obd_lbug_on_eviction;
+extern unsigned int obd_dump_on_eviction;
+
+static inline bool do_dump_on_eviction(struct obd_device *exp_obd)
+{
+ if (obd_lbug_on_eviction &&
+ strncmp(exp_obd->obd_type->typ_name, LUSTRE_MGC_NAME,
+ strlen(LUSTRE_MGC_NAME))) {
+ CERROR("LBUG upon eviction\n");
+ LBUG();
+ }
+
+ return obd_dump_on_eviction;
+}
+
/* statfs_pack.c */
struct kstatfs;
void statfs_pack(struct obd_statfs *osfs, struct kstatfs *sfs);
@@ -1473,13 +1473,12 @@ static int ptlrpc_invalidate_import_thread(void *data)
imp->imp_obd->obd_name, obd2cli_tgt(imp->imp_obd),
imp->imp_connection->c_remote_uuid.uuid);
- ptlrpc_invalidate_import(imp);
-
- if (obd_dump_on_eviction) {
+ if (do_dump_on_eviction(imp->imp_obd)) {
CERROR("dump the log upon eviction\n");
libcfs_debug_dumplog();
}
+ ptlrpc_invalidate_import(imp);
import_set_state(imp, LUSTRE_IMP_RECOVER);
ptlrpc_import_recovery_state_machine(imp);