aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/inode.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 9b43a6f303b8..ddb0f0ecda6c 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -2504,7 +2504,7 @@ noinline int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
2504 struct btrfs_path *path; 2504 struct btrfs_path *path;
2505 struct btrfs_key key; 2505 struct btrfs_key key;
2506 struct btrfs_key found_key; 2506 struct btrfs_key found_key;
2507 u32 found_type; 2507 u32 found_type = (u8)-1;
2508 struct extent_buffer *leaf; 2508 struct extent_buffer *leaf;
2509 struct btrfs_file_extent_item *fi; 2509 struct btrfs_file_extent_item *fi;
2510 u64 extent_start = 0; 2510 u64 extent_start = 0;
@@ -2691,6 +2691,8 @@ next:
2691 if (pending_del_nr) 2691 if (pending_del_nr)
2692 goto del_pending; 2692 goto del_pending;
2693 btrfs_release_path(root, path); 2693 btrfs_release_path(root, path);
2694 if (found_type == BTRFS_INODE_ITEM_KEY)
2695 break;
2694 goto search_again; 2696 goto search_again;
2695 } 2697 }
2696 2698
@@ -2707,6 +2709,8 @@ del_pending:
2707 BUG_ON(ret); 2709 BUG_ON(ret);
2708 pending_del_nr = 0; 2710 pending_del_nr = 0;
2709 btrfs_release_path(root, path); 2711 btrfs_release_path(root, path);
2712 if (found_type == BTRFS_INODE_ITEM_KEY)
2713 break;
2710 goto search_again; 2714 goto search_again;
2711 } 2715 }
2712 } 2716 }