diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 679dc97354bef4b2df954671b5f711f81b0cdef0..a3316f1707e6d801ed195c2585ef0805ad9edd4a 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -509,7 +509,7 @@ static int __add_missing_keys(struct btrfs_fs_info *fs_info, } /* - * merge two lists of backrefs and adjust counts accordingly + * merge backrefs and adjust counts accordingly * * mode = 1: merge identical keys, if key is set * FIXME: if we add more keys in __add_prelim_ref, we can merge more here. @@ -537,9 +537,9 @@ static void __merge_refs(struct list_head *head, int mode) ref2 = list_entry(pos2, struct __prelim_ref, list); + if (!ref_for_same_block(ref1, ref2)) + continue; if (mode == 1) { - if (!ref_for_same_block(ref1, ref2)) - continue; if (!ref1->parent && ref2->parent) { xchg = ref1; ref1 = ref2;