|
@@ -696,6 +696,7 @@ struct backref_node *build_backref_tree(struct reloc_control *rc,
|
|
int cowonly;
|
|
int cowonly;
|
|
int ret;
|
|
int ret;
|
|
int err = 0;
|
|
int err = 0;
|
|
|
|
+ bool need_check = true;
|
|
|
|
|
|
path1 = btrfs_alloc_path();
|
|
path1 = btrfs_alloc_path();
|
|
path2 = btrfs_alloc_path();
|
|
path2 = btrfs_alloc_path();
|
|
@@ -919,6 +920,7 @@ again:
|
|
cur->bytenr);
|
|
cur->bytenr);
|
|
|
|
|
|
lower = cur;
|
|
lower = cur;
|
|
|
|
+ need_check = true;
|
|
for (; level < BTRFS_MAX_LEVEL; level++) {
|
|
for (; level < BTRFS_MAX_LEVEL; level++) {
|
|
if (!path2->nodes[level]) {
|
|
if (!path2->nodes[level]) {
|
|
BUG_ON(btrfs_root_bytenr(&root->root_item) !=
|
|
BUG_ON(btrfs_root_bytenr(&root->root_item) !=
|
|
@@ -962,14 +964,12 @@ again:
|
|
|
|
|
|
/*
|
|
/*
|
|
* add the block to pending list if we
|
|
* add the block to pending list if we
|
|
- * need check its backrefs. only block
|
|
|
|
- * at 'cur->level + 1' is added to the
|
|
|
|
- * tail of pending list. this guarantees
|
|
|
|
- * we check backrefs from lower level
|
|
|
|
- * blocks to upper level blocks.
|
|
|
|
|
|
+ * need check its backrefs, we only do this once
|
|
|
|
+ * while walking up a tree as we will catch
|
|
|
|
+ * anything else later on.
|
|
*/
|
|
*/
|
|
- if (!upper->checked &&
|
|
|
|
- level == cur->level + 1) {
|
|
|
|
|
|
+ if (!upper->checked && need_check) {
|
|
|
|
+ need_check = false;
|
|
list_add_tail(&edge->list[UPPER],
|
|
list_add_tail(&edge->list[UPPER],
|
|
&list);
|
|
&list);
|
|
} else
|
|
} else
|