void l_unlock(struct lustre_lock *lock)
{
- LASSERT(lock->l_owner == current);
- LASSERT(lock->l_depth >= 0);
-
+ LASSERTF(lock->l_owner == current, "lock %p, current %p\n",
+ lock->l_owner, current);
+ LASSERTF(lock->l_depth >= 0, "depth %d\n", lock->l_depth);
spin_lock(&lock->l_spin);
if (--lock->l_depth < 0) {
lock->l_owner = NULL;
CDEBUG(D_INFO, "lock_depth: %d\n", depth);
return owner;
}
+
+#ifdef __KERNEL__
+#include <linux/lustre_version.h>
+void l_check_no_ns_lock(struct ldlm_namespace *ns)
+{
+ static unsigned long next_msg;
+
+ if (l_has_lock(&ns->ns_lock) && time_after(jiffies, next_msg)) {
+ CERROR("namespace %s lock held illegally; tell phil\n",
+ ns->ns_name);
+ portals_debug_dumpstack(NULL);
+ next_msg = jiffies + 60 * HZ;
+ }
+}
+
+#else
+void l_check_no_ns_lock(struct ldlm_namespace *ns)
+{
+ if (l_has_lock(&ns->ns_lock)) {
+ CERROR("namespace %s lock held illegally; tell phil\n",
+ ns->ns_name);
+ }
+}
+#endif /* __KERNEL__ */