+ cfs_spin_lock_bh(&lcw_pending_timers_lock);
+ while (!cfs_list_empty(&lcw_pending_timers)) {
+ int is_dumplog;
+
+ lcw = cfs_list_entry(lcw_pending_timers.next,
+ struct lc_watchdog, lcw_list);
+ /* +1 ref for callback to make sure lwc wouldn't be
+ * deleted after releasing lcw_pending_timers_lock */
+ lcw->lcw_refcount++;
+ cfs_spin_unlock_bh(&lcw_pending_timers_lock);
+
+ /* lock ordering */
+ cfs_spin_lock_bh(&lcw->lcw_lock);
+ cfs_spin_lock_bh(&lcw_pending_timers_lock);
+
+ if (cfs_list_empty(&lcw->lcw_list)) {
+ /* already removed from pending list */
+ lcw->lcw_refcount--; /* -1 ref for callback */
+ if (lcw->lcw_refcount == 0)
+ cfs_list_add(&lcw->lcw_list, &zombies);
+ cfs_spin_unlock_bh(&lcw->lcw_lock);
+ /* still hold lcw_pending_timers_lock */
+ continue;
+ }
+
+ cfs_list_del_init(&lcw->lcw_list);
+ lcw->lcw_refcount--; /* -1 ref for pending list */