From b9acef3432cbb0d451136da6c69e17a22fae9ab3 Mon Sep 17 00:00:00 2001 From: Fabiano Parente Date: Sat, 3 May 2025 10:18:47 -0300 Subject: [PATCH] Fix incomplete subvolume detection for receive targets The previous code only checked for received_uuid being '-', but some incomplete received subvolumes might have readonly flag disabled while having valid received_uuid. This change ensures both conditions are checked for proper cleanup. --- btrbk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btrbk b/btrbk index 2655e1b..b4c374f 100755 --- a/btrbk +++ b/btrbk @@ -6762,7 +6762,7 @@ MAIN: # incomplete received (garbled) subvolumes are not readonly and have no received_uuid (as of btrfs-progs v4.3.1). # a subvolume in droot matching our naming is considered incomplete if received_uuid is not set! - my @delete = grep $_->{node}{received_uuid} eq '-', @{vinfo_subvol_list($droot, btrbk_direct_leaf => $snapshot_name, sort => 'path')}; + my @delete = grep { !$_->{node}{readonly} || $_->{node}{received_uuid} eq '-' } @{vinfo_subvol_list($droot, btrbk_direct_leaf => $snapshot_name, sort => 'path')}; my @delete_success; foreach my $target_vol (@delete) { DEBUG "Found incomplete target subvolume: $target_vol->{PRINT}";