- l_wait_event(lcm->lcm_waitq,
- atomic_read(&lcm->lcm_count) == 0, &lwi);
+ if (atomic_read(&lcm->lcm_count) != 0) {
+ struct llog_canceld_ctxt *llcd;
+ struct list_head *tmp;
+
+ CERROR("Busy llcds found (%d) on lcm %p\n",
+ atomic_read(&lcm->lcm_count) == 0, lcm);
+
+ spin_lock(&lcm->lcm_lock);
+ list_for_each(tmp, &lcm->lcm_llcds) {
+ llcd = list_entry(tmp, struct llog_canceld_ctxt,
+ llcd_list);
+ llcd_print(llcd, __FUNCTION__, __LINE__);
+ }
+ spin_unlock(&lcm->lcm_lock);
+
+ /*
+ * No point to go further with busy llcds at this point
+ * as this is clear bug. It might mean we got hanging
+ * rpc which holds import ref and this means we will not
+ * be able to cleanup anyways.
+ *
+ * Or we just missed to kill them when they were not
+ * attached to ctxt. In this case our slab will remind
+ * us about this a bit later.
+ */
+ LBUG();
+ }