Whamcloud - gitweb
LU-13811 client: don't panic for mgs evictions
[fs/lustre-release.git] / lustre / include / obd_class.h
index a1b087e..093682f 100644 (file)
@@ -1847,6 +1847,21 @@ int class_check_uuid(struct obd_uuid *uuid, __u64 nid);
 /* class_obd.c */
 extern char obd_jobid_name[];
 
 /* class_obd.c */
 extern char obd_jobid_name[];
 
+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);
 /* statfs_pack.c */
 struct kstatfs;
 void statfs_pack(struct obd_statfs *osfs, struct kstatfs *sfs);