+
+ if (!removed)
+ return;
+
+ /* See lustre_notify_lwp_list(), in some extreme race conditions,
+ * the notify callback could be still on the fly, we need to wait
+ * for the callback done before moving on to free the data used
+ * by callback. */
+ while (atomic_read(&lri->lri_ref) > 1) {
+ CDEBUG(D_MOUNT, "lri reference count %u, repeat: %d\n",
+ atomic_read(&lri->lri_ref), repeat);
+ repeat++;
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout(cfs_time_seconds(1));
+ }
+ lustre_put_lwp_item(lri);