From e3ee674085c11fc8ac8540650f4647f32000dd4b Mon Sep 17 00:00:00 2001 From: Axel Burri Date: Tue, 10 Oct 2017 16:44:19 +0200 Subject: [PATCH] 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(). --- btrbk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btrbk b/btrbk index f924e0f..8e35fb3 100755 --- a/btrbk +++ b/btrbk @@ -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;