return error;
 }
 
-/* If there's an rsb for the same resource being removed, ensure
- * that the remove message is sent before the new lookup message.
- */
-
-#define DLM_WAIT_PENDING_COND(ls, r)           \
-       (ls->ls_remove_len &&                   \
-        !rsb_cmp(r, ls->ls_remove_name,        \
-                 ls->ls_remove_len))
-
-static void wait_pending_remove(struct dlm_rsb *r)
-{
-       struct dlm_ls *ls = r->res_ls;
- restart:
-       spin_lock(&ls->ls_remove_spin);
-       if (DLM_WAIT_PENDING_COND(ls, r)) {
-               log_debug(ls, "delay lookup for remove dir %d %s",
-                         r->res_dir_nodeid, r->res_name);
-               spin_unlock(&ls->ls_remove_spin);
-               wait_event(ls->ls_remove_wait, !DLM_WAIT_PENDING_COND(ls, r));
-               goto restart;
-       }
-       spin_unlock(&ls->ls_remove_spin);
-}
-
-/*
- * ls_remove_spin protects ls_remove_name and ls_remove_len which are
- * read by other threads in wait_pending_remove.  ls_remove_names
- * and ls_remove_lens are only used by the scan thread, so they do
- * not need protection.
- */
-
 static void shrink_bucket(struct dlm_ls *ls, int b)
 {
        struct rb_node *n, *next;
         * list and sending the removal.  Keeping this gap small is
         * important to keep us (the master node) from being out of sync
         * with the remote dir node for very long.
-        *
-        * From the time the rsb is removed from toss until just after
-        * send_remove, the rsb name is saved in ls_remove_name.  A new
-        * lookup checks this to ensure that a new lookup message for the
-        * same resource name is not sent just before the remove message.
         */
 
        for (i = 0; i < remote_count; i++) {
                }
 
                rb_erase(&r->res_hashnode, &ls->ls_rsbtbl[b].toss);
-
-               /* block lookup of same name until we've sent remove */
-               spin_lock(&ls->ls_remove_spin);
-               ls->ls_remove_len = len;
-               memcpy(ls->ls_remove_name, name, DLM_RESNAME_MAXLEN);
-               spin_unlock(&ls->ls_remove_spin);
-               spin_unlock(&ls->ls_rsbtbl[b].lock);
-
                send_remove(r);
-
-               /* allow lookup of name again */
-               spin_lock(&ls->ls_remove_spin);
-               ls->ls_remove_len = 0;
-               memset(ls->ls_remove_name, 0, DLM_RESNAME_MAXLEN);
-               spin_unlock(&ls->ls_remove_spin);
-               wake_up(&ls->ls_remove_wait);
+               spin_unlock(&ls->ls_rsbtbl[b].lock);
 
                dlm_free_rsb(r);
        }
                return 0;
        }
 
-       wait_pending_remove(r);
-
        r->res_first_lkid = lkb->lkb_id;
        send_lookup(r, lkb);
        return 1;
        to_nodeid = dlm_dir_nodeid(r);
 
        error = create_message(r, NULL, to_nodeid, DLM_MSG_REMOVE, &ms, &mh,
-                              GFP_NOFS);
+                              GFP_ATOMIC);
        if (error)
                goto out;