aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/disk-io.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 63a36232788b..ffdd76bf05d4 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3557,8 +3557,10 @@ static int btrfs_destroy_pinned_extent(struct btrfs_root *root,
3557 u64 start; 3557 u64 start;
3558 u64 end; 3558 u64 end;
3559 int ret; 3559 int ret;
3560 bool loop = true;
3560 3561
3561 unpin = pinned_extents; 3562 unpin = pinned_extents;
3563again:
3562 while (1) { 3564 while (1) {
3563 ret = find_first_extent_bit(unpin, 0, &start, &end, 3565 ret = find_first_extent_bit(unpin, 0, &start, &end,
3564 EXTENT_DIRTY); 3566 EXTENT_DIRTY);
@@ -3576,6 +3578,15 @@ static int btrfs_destroy_pinned_extent(struct btrfs_root *root,
3576 cond_resched(); 3578 cond_resched();
3577 } 3579 }
3578 3580
3581 if (loop) {
3582 if (unpin == &root->fs_info->freed_extents[0])
3583 unpin = &root->fs_info->freed_extents[1];
3584 else
3585 unpin = &root->fs_info->freed_extents[0];
3586 loop = false;
3587 goto again;
3588 }
3589
3579 return 0; 3590 return 0;
3580} 3591}
3581 3592