# define might_lock_read(lock) do { } while (0)
 #endif
 
+#ifdef CONFIG_PROVE_RCU
+extern void lockdep_rcu_dereference(const char *file, const int line);
+#endif
+
 #endif /* __LINUX_LOCKDEP_H */
 
  */
 #define rcu_dereference_check(p, c) \
        ({ \
-               if (debug_locks) \
-                       WARN_ON_ONCE(!(c)); \
+               if (debug_locks && !(c)) \
+                       lockdep_rcu_dereference(__FILE__, __LINE__); \
                rcu_dereference_raw(p); \
        })
 
 
                lockdep_print_held_locks(curr);
        }
 }
+
+void lockdep_rcu_dereference(const char *file, const int line)
+{
+       struct task_struct *curr = current;
+
+       if (!debug_locks_off())
+               return;
+       printk("\n==============================================\n");
+       printk(  "[ BUG: Unsafe rcu_dereference_check() usage! ]\n");
+       printk(  "----------------------------------------------\n");
+       printk("%s:%d invoked rcu_dereference_check() without protection!\n",
+                       file, line);
+       printk("\nother info that might help us debug this:\n\n");
+       lockdep_print_held_locks(curr);
+       printk("\nstack backtrace:\n");
+       dump_stack();
+}
+EXPORT_SYMBOL_GPL(lockdep_rcu_dereference);