btrbk: correct parsing of btrfs subvolume list (allow id < top_level)

pull/30/head
Axel Burri 2015-06-17 12:42:29 +02:00
parent 8a53b3874c
commit 360deca5f2
2 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,7 @@
btrbk-current
* Bugfix: fix sorting of dates in schedule().
* Bugfix: correct parsing of btrfs subvolume list (closes: #28).
btrbk-0.19.2

10
btrbk
View File

@ -895,11 +895,15 @@ sub btr_tree($)
foreach my $node (@$subvol_list)
{
$id{$node->{id}} = $node;
$uuid_info{$node->{uuid}} = $node;
$node->{SUBTREE} //= {};
$id{$node->{id}} = $node;
$uuid_info{$node->{uuid}} = $node;
}
# note: it is possible that id < top_level, e.g. after restoring
foreach my $node (@$subvol_list)
{
# set SUBTREE / TOP_LEVEL node
die unless exists($id{$node->{top_level}});
my $top_level = $id{$node->{top_level}};