From 31475a303fba41886b9cdddb26e28aab14267b01 Mon Sep 17 00:00:00 2001 From: Gavin Yancey Date: Wed, 8 Jul 2020 01:35:04 -0700 Subject: [PATCH] btrbk: look in the correct directory for btrbk list snapshots --- btrbk | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/btrbk b/btrbk index ca619ef..d4d5161 100755 --- a/btrbk +++ b/btrbk @@ -6721,8 +6721,9 @@ MAIN: foreach my $sroot (vinfo_subsection($config, 'volume')) { foreach my $svol (vinfo_subsection($sroot, 'subvolume')) { my $snapshot_name = config_key($svol, "snapshot_name") // die; - # note: we list all snapshot children within $sroot here, not only the ones matching btrbk naming - foreach my $snapshot (sort { $a->{node}{cgen} <=> $b->{node}{cgen} } get_related_snapshots($sroot, $svol)) { + my $snaproot = vinfo_snapshot_root($svol); + # note: we list all snapshot children within $snaproot here, not only the ones matching btrbk naming + foreach my $snapshot (sort { $a->{node}{cgen} <=> $b->{node}{cgen} } get_related_snapshots($snaproot, $svol)) { my $snapshot_data = { type => "snapshot", status => ($snapshot->{node}{cgen} == $svol->{node}{gen}) ? "up-to-date" : undef, vinfo_prefixed_keys("source", $svol), @@ -6753,8 +6754,9 @@ MAIN: foreach my $sroot (vinfo_subsection($config, 'volume')) { foreach my $svol (vinfo_subsection($sroot, 'subvolume')) { my $snapshot_name = config_key($svol, "snapshot_name") // die; - # note: we list all snapshot children within $sroot here, not only the ones matching btrbk naming - my @related_snapshots = get_related_snapshots($sroot, $svol); + my $snaproot = vinfo_snapshot_root($svol); + # note: we list all snapshot children within $snaproot here, not only the ones matching btrbk naming + my @related_snapshots = get_related_snapshots($snaproot, $svol); my $stats_snapshot_uptodate = ""; foreach my $snapshot (@related_snapshots) { if($snapshot->{node}{cgen} == $svol->{node}{gen}) {