mirror of
https://github.com/torvalds/linux.git
synced 2024-11-06 20:21:57 +00:00
Btrfs: support root level changes in __resolve_indirect_ref
With the tree mod log, we can have a tree that's two levels high, but btrfs_search_old_slot may still return a path with the tree root at level one instead. __resolve_indirect_ref must care for this and accept parents in a lower level than expected. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
This commit is contained in:
parent
8ca78f3eda
commit
9345457f4a
@ -301,10 +301,14 @@ static int __resolve_indirect_ref(struct btrfs_fs_info *fs_info,
|
||||
goto out;
|
||||
|
||||
eb = path->nodes[level];
|
||||
if (!eb) {
|
||||
WARN_ON(1);
|
||||
ret = 1;
|
||||
goto out;
|
||||
while (!eb) {
|
||||
if (!level) {
|
||||
WARN_ON(1);
|
||||
ret = 1;
|
||||
goto out;
|
||||
}
|
||||
level--;
|
||||
eb = path->nodes[level];
|
||||
}
|
||||
|
||||
ret = add_all_parents(root, path, parents, level, &ref->key_for_search,
|
||||
|
Loading…
Reference in New Issue
Block a user