From 0172e4a2406c792404a8d994967a4fd645cb5f44 Mon Sep 17 00:00:00 2001 From: Axel Burri Date: Sun, 6 Feb 2022 11:55:04 +0100 Subject: [PATCH] btrbk: fix mountinfo tree root detection Set node as tree root if mount_id == parent_id. For some reasons this is never the case on my (mostly gentoo) systems. Regression from: eb69bc88 btrbk: refactor mountinfo --- btrbk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/btrbk b/btrbk index 0f74d4b..0a56083 100755 --- a/btrbk +++ b/btrbk @@ -2958,7 +2958,8 @@ sub mountinfo_tree($) my %id = map +( $_->{mount_id} => $_ ), @$mountinfo; my $tree_root; foreach my $node (@$mountinfo) { - if(my $parent = $id{$node->{parent_id}}) { + my $parent = $id{$node->{parent_id}}; + if($parent && ($node->{mount_id} != $node->{parent_id})) { $node->{PARENT} = $parent; push @{$parent->{SUBTREE}}, $node; } else {