Whamcloud - gitweb
Revert "LU-2272 statahead: ll_intent_drop_lock() called in spinlock"
[fs/lustre-release.git] / lustre / llite / statahead.c
index 1c116c1..26fb4e7 100644 (file)
@@ -712,22 +712,12 @@ static int ll_statahead_interpret(struct ptlrpc_request *req,
         struct ll_inode_info     *lli = ll_i2info(dir);
         struct ll_statahead_info *sai = NULL;
         struct ll_sa_entry       *entry;
-       __u64 handle              = 0;
         int                       wakeup;
         ENTRY;
 
         if (it_disposition(it, DISP_LOOKUP_NEG))
                 rc = -ENOENT;
 
-       if (rc == 0) {
-               /* release ibits lock ASAP to avoid deadlock when statahead
-                * thread enqueues lock on parent in readdir and another
-                * process enqueues lock on child with parent lock held, eg.
-                * unlink. */
-               handle = it->d.lustre.it_lock_handle;
-               ll_intent_drop_lock(it);
-       }
-
        spin_lock(&lli->lli_sa_lock);
        /* stale entry */
        if (unlikely(lli->lli_sai == NULL ||
@@ -759,7 +749,8 @@ static int ll_statahead_interpret(struct ptlrpc_request *req,
                         * when statahead thread tries to enqueue lock on parent
                         * for readpage and other tries to enqueue lock on child
                         * with parent's lock held, for example: unlink. */
-                       entry->se_handle = handle;
+                       entry->se_handle = it->d.lustre.it_lock_handle;
+                       ll_intent_drop_lock(it);
                        wakeup = sa_received_empty(sai);
                        cfs_list_add_tail(&entry->se_list,
                                          &sai->sai_entries_received);