From 631a4c30fe3bcdce9584f73555e2addd8e05c356 Mon Sep 17 00:00:00 2001 From: Axel Burri Date: Sun, 15 Dec 2019 18:47:27 +0100 Subject: [PATCH] btrbk: fix @stderr propagation from vinfo_init_root As we print @stderr in warnings if vinfo_init_root() function fails, we need to make sure that @stderr contains sane values. Clearing @stderr is required when calling caching functions! --- btrbk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/btrbk b/btrbk index df08a46..46b45e2 100755 --- a/btrbk +++ b/btrbk @@ -2626,10 +2626,12 @@ sub vinfo_init_root($) my $vol = shift || die; # resolve btrfs tree from mount point + @stderr = (); # clear @stderr (propagated for logging) my ($mnt_path, $real_path, $subvolid, $mount_source, $mountpoints) = btrfs_mountpoint($vol); return undef unless($mnt_path && $real_path && $subvolid); # read btrfs tree for the mount point + @stderr = (); # clear @stderr (propagated for logging) my $mnt_vol = vinfo($vol->{URL_PREFIX} . $mnt_path, $vol->{CONFIG}); my $mnt_tree_root = btr_tree($mnt_vol, $subvolid, $mount_source, $mountpoints); return undef unless($mnt_tree_root);