- if (ns->ns_refcount)
- LCONSOLE_ERROR_MSG(0x139, "Lock manager: wait for %s "
- "namespace cleanup aborted with %d "
- "resources in use. (%d)\nI'm going "
- "to try to clean up anyway, but I "
- "might need a reboot of this node.\n",
- ns->ns_name, (int) ns->ns_refcount,
- rc);
+
+ /* Forced cleanups should be able to reclaim all references,
+ * so it's safe to wait forever... we can't leak locks... */
+ if (force && rc == -ETIMEDOUT) {
+ LCONSOLE_ERROR("Forced cleanup waiting for %s "
+ "namespace with %d resources in use, "
+ "(rc=%d)\n", ns->ns_name,
+ ns->ns_refcount, rc);
+ GOTO(force_wait, rc);
+ }
+
+ if (ns->ns_refcount) {
+ LCONSOLE_ERROR("Cleanup waiting for %s namespace "
+ "with %d resources in use, (rc=%d)\n",
+ ns->ns_name,
+ ns->ns_refcount, rc);
+ RETURN(ELDLM_NAMESPACE_EXISTS);
+ }