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.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index d6243c2afc73..91c2b27d9689 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -688,7 +688,7 @@ u32 btrfs_count_snapshots_in_path(struct btrfs_root *root,
688 struct btrfs_path *path; 688 struct btrfs_path *path;
689 u64 bytenr; 689 u64 bytenr;
690 u64 found_objectid; 690 u64 found_objectid;
691 u64 root_objectid = 0; 691 u64 root_objectid = root->root_key.objectid;
692 u32 total_count = 0; 692 u32 total_count = 0;
693 u32 cur_count; 693 u32 cur_count;
694 u32 refs; 694 u32 refs;
@@ -749,15 +749,11 @@ again:
749 struct btrfs_extent_ref); 749 struct btrfs_extent_ref);
750 found_objectid = btrfs_ref_root(l, ref_item); 750 found_objectid = btrfs_ref_root(l, ref_item);
751 751
752 if (found_objectid != root_objectid) 752 if (found_objectid != root_objectid) {
753 total_count++; 753 total_count = 2;
754 754 break;
755 if (total_count > 1) 755 }
756 goto out; 756 total_count = 1;
757
758 if (root_objectid == 0)
759 root_objectid = found_objectid;
760
761 path->slots[0]++; 757 path->slots[0]++;
762 } 758 }
763 if (cur_count == 0) { 759 if (cur_count == 0) {