aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 89cc4f611869..a9b3a25a45b7 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -2201,6 +2201,7 @@ int drop_snap_lookup_refcount(struct btrfs_root *root, u64 start, u64 len,
2201{ 2201{
2202 mutex_unlock(&root->fs_info->alloc_mutex); 2202 mutex_unlock(&root->fs_info->alloc_mutex);
2203 lookup_extent_ref(NULL, root, start, len, refs); 2203 lookup_extent_ref(NULL, root, start, len, refs);
2204 cond_resched();
2204 mutex_lock(&root->fs_info->alloc_mutex); 2205 mutex_lock(&root->fs_info->alloc_mutex);
2205 return lookup_extent_ref(NULL, root, start, len, refs); 2206 return lookup_extent_ref(NULL, root, start, len, refs);
2206} 2207}
@@ -2280,6 +2281,7 @@ static int noinline walk_down_tree(struct btrfs_trans_handle *trans,
2280 2281
2281 next = read_tree_block(root, bytenr, blocksize, 2282 next = read_tree_block(root, bytenr, blocksize,
2282 ptr_gen); 2283 ptr_gen);
2284 cond_resched();
2283 mutex_lock(&root->fs_info->alloc_mutex); 2285 mutex_lock(&root->fs_info->alloc_mutex);
2284 2286
2285 /* we've dropped the lock, double check */ 2287 /* we've dropped the lock, double check */
@@ -2329,6 +2331,7 @@ out:
2329 *level += 1; 2331 *level += 1;
2330 BUG_ON(ret); 2332 BUG_ON(ret);
2331 mutex_unlock(&root->fs_info->alloc_mutex); 2333 mutex_unlock(&root->fs_info->alloc_mutex);
2334 cond_resched();
2332 return 0; 2335 return 0;
2333} 2336}
2334 2337
@@ -2448,6 +2451,10 @@ int btrfs_drop_snapshot(struct btrfs_trans_handle *trans, struct btrfs_root
2448 break; 2451 break;
2449 if (wret < 0) 2452 if (wret < 0)
2450 ret = wret; 2453 ret = wret;
2454 if (trans->transaction->in_commit) {
2455 ret = -EAGAIN;
2456 break;
2457 }
2451 } 2458 }
2452 for (i = 0; i <= orig_level; i++) { 2459 for (i = 0; i <= orig_level; i++) {
2453 if (path->nodes[i]) { 2460 if (path->nodes[i]) {