The l_wait_event call in __ldlm_namespace_free() can do one
of two things depending on which LWI_* setup call is in effect.
If 'force', it ignores signals and times out after 1/4 second.
If '!force', it has no timeout but allows fatal signals.
So change it to two separate calls: wait_event_idle_timeout()
or l_wait_event_abortable().
Signed-off-by: Mr NeilBrown <neilb@suse.com>
Change-Id: I1ac7ff5daa80581010cd913f01650c07ac40c151
Reviewed-on: https://review.whamcloud.com/35989
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Shaun Tancheff <stancheff@cray.com>
Reviewed-by: Petros Koutoupis <pkoutoupis@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
ldlm_namespace_cleanup(ns, force ? LDLM_FL_LOCAL_ONLY : 0);
if (atomic_read(&ns->ns_bref) > 0) {
ldlm_namespace_cleanup(ns, force ? LDLM_FL_LOCAL_ONLY : 0);
if (atomic_read(&ns->ns_bref) > 0) {
- struct l_wait_info lwi = LWI_INTR(LWI_ON_SIGNAL_NOOP, NULL);
int rc;
CDEBUG(D_DLMTRACE,
"dlm namespace %s free waiting on refcount %d\n",
ldlm_ns_name(ns), atomic_read(&ns->ns_bref));
force_wait:
if (force)
int rc;
CDEBUG(D_DLMTRACE,
"dlm namespace %s free waiting on refcount %d\n",
ldlm_ns_name(ns), atomic_read(&ns->ns_bref));
force_wait:
if (force)
- lwi = LWI_TIMEOUT(cfs_time_seconds(1) / 4,
- NULL, NULL);
-
- rc = l_wait_event(ns->ns_waitq,
- atomic_read(&ns->ns_bref) == 0, &lwi);
+ rc = wait_event_idle_timeout(
+ ns->ns_waitq,
+ atomic_read(&ns->ns_bref) == 0,
+ cfs_time_seconds(1) / 4);
+ else
+ rc = l_wait_event_abortable(
+ ns->ns_waitq, atomic_read(&ns->ns_bref) == 0);
/* Forced cleanups should be able to reclaim all references,
* so it's safe to wait forever... we can't leak locks... */
/* 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) {
+ if (force && rc == 0) {
+ rc = -ETIMEDOUT;
LCONSOLE_ERROR("Forced cleanup waiting for %s "
"namespace with %d resources in use, "
"(rc=%d)\n", ldlm_ns_name(ns),
LCONSOLE_ERROR("Forced cleanup waiting for %s "
"namespace with %d resources in use, "
"(rc=%d)\n", ldlm_ns_name(ns),