summaryrefslogtreecommitdiff
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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 2fe21fa74913..dc84daee6bc4 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -302,10 +302,11 @@ again:
else if (ret)
break;
- if (need_resched()) {
+ if (need_resched() ||
+ btrfs_transaction_in_commit(fs_info)) {
btrfs_release_path(fs_info->extent_root, path);
up_read(&fs_info->extent_commit_sem);
- cond_resched();
+ schedule_timeout(1);
goto again;
}