aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChris Mason <chris.mason@fusionio.com>2012-07-25 15:57:13 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-09 11:27:50 -0400
commit4ffd3692dd84a5979310c5e86bcf942e4b46c9ce (patch)
tree461078fda1207a41a7cff45cb0204bfa4639b8b8 /fs
parent53895e01fe540ddd0c9f2615468a04cb48d9ed2f (diff)
Btrfs: call the ordered free operation without any locks held
commit e9fbcb42201c862fd6ab45c48ead4f47bb2dea9d upstream. Each ordered operation has a free callback, and this was called with the worker spinlock held. Josef made the free callback also call iput, which we can't do with the spinlock. This drops the spinlock for the free operation and grabs it again before moving through the rest of the list. We'll circle back around to this and find a cleaner way that doesn't bounce the lock around so much. Signed-off-by: Chris Mason <chris.mason@fusionio.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/async-thread.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c
index 7ec14097fef..8006a28390f 100644
--- a/fs/btrfs/async-thread.c
+++ b/fs/btrfs/async-thread.c
@@ -212,10 +212,17 @@ static noinline int run_ordered_completions(struct btrfs_workers *workers,
212 212
213 work->ordered_func(work); 213 work->ordered_func(work);
214 214
215 /* now take the lock again and call the freeing code */ 215 /* now take the lock again and drop our item from the list */
216 spin_lock(&workers->order_lock); 216 spin_lock(&workers->order_lock);
217 list_del(&work->order_list); 217 list_del(&work->order_list);
218 spin_unlock(&workers->order_lock);
219
220 /*
221 * we don't want to call the ordered free functions
222 * with the lock held though
223 */
218 work->ordered_free(work); 224 work->ordered_free(work);
225 spin_lock(&workers->order_lock);
219 } 226 }
220 227
221 spin_unlock(&workers->order_lock); 228 spin_unlock(&workers->order_lock);