hugetlb: ensure hugepage access is denied if hugepages are not supported
[pandora-kernel.git] / fs / btrfs / async-thread.c
index 0b39458..03321e5 100644 (file)
@@ -206,10 +206,17 @@ static noinline int run_ordered_completions(struct btrfs_workers *workers,
 
                work->ordered_func(work);
 
-               /* now take the lock again and call the freeing code */
+               /* now take the lock again and drop our item from the list */
                spin_lock(&workers->order_lock);
                list_del(&work->order_list);
+               spin_unlock(&workers->order_lock);
+
+               /*
+                * we don't want to call the ordered free functions
+                * with the lock held though
+                */
                work->ordered_free(work);
+               spin_lock(&workers->order_lock);
        }
 
        spin_unlock(&workers->order_lock);