scoutfs: dlmglue should initialize res->l_debug_list

We're missing initialization of this field. It should never cause a
problem today because we always do a list add immediately afterwards
but let's be extra careful here and initialize it just in case. We
also add a sanity check in ocfs2_add_lockres_tracking() that the
lockres hasn't already been put on the debug list.

Signed-off-by: Mark Fasheh <mfasheh@versity.com>
This commit is contained in:
Mark Fasheh
2017-09-08 13:29:56 -07:00
committed by Zach Brown
parent f276771d8c
commit b1fff0997e
+2
View File
@@ -456,6 +456,7 @@ static void ocfs2_add_lockres_tracking(struct ocfs2_lock_res *res,
mlog(0, "Add tracking for lockres %s\n", res->l_name);
spin_lock(&ocfs2_dlm_tracking_lock);
BUG_ON(!list_empty(&res->l_debug_list));
list_add(&res->l_debug_list, &dlm_debug->d_lockres_tracking);
spin_unlock(&ocfs2_dlm_tracking_lock);
}
@@ -570,6 +571,7 @@ void ocfs2_lock_res_init_once(struct ocfs2_lock_res *res)
INIT_LIST_HEAD(&res->l_blocked_list);
INIT_LIST_HEAD(&res->l_mask_waiters);
INIT_LIST_HEAD(&res->l_holders);
INIT_LIST_HEAD(&res->l_debug_list);
}
#if 0