btrbk: limit search depth to 256 when resolving ancestors

Note that the current implementation is not very optimized, we should
introduce a parent/child hash table for all queries in
get_latest_common().
pull/204/head
Axel Burri 2017-10-10 16:44:19 +02:00
parent 3be65b9f67
commit e3ee674085
1 changed files with 1 additions and 1 deletions

2
btrbk
View File

@ -2845,7 +2845,7 @@ sub get_latest_common($$$;$)
# add read-only ancestors from parent chain (recursive!)
my $rnode = $svol->{node};
my $search_depth = 0;
while($rnode && ($search_depth < 16)) {
while($rnode && ($search_depth < 256)) {
last if($rnode->{parent_uuid} eq '-');
TRACE "get_latest_common: searching parent chain (depth=$search_depth): $rnode->{uuid}";
my @parents = grep { $_->{node}{uuid} eq $rnode->{parent_uuid} } @$sroot_subvol_list;