btrbk: it is now possible to back up a subvolume that is already mounted at /.

It works with the configuration snippet below:

```
volume /
  subvolume  .
    snapshot_create  ondemand
    snapshot_name    root
    target send-receive      /mnt/ext-backup/snapshots
```
pull/240/head
teesid 2018-06-29 09:36:10 +07:00
parent 2f95baf6f3
commit 3fe746ed64
1 changed files with 4 additions and 1 deletions

5
btrbk
View File

@ -5303,7 +5303,10 @@ MAIN:
WARN "Skipping subvolume \"$svol->{PRINT}\": $abrt";
next;
}
if($svol->{node}{uuid} && _is_child_of($sroot->{node}, $svol->{node}{uuid})) {
if($svol->{node}{uuid} &&
(_is_child_of($sroot->{node}, $svol->{node}{uuid}) ||
($svol->{node}{uuid} eq $sroot->{node}{uuid})))
{
DEBUG "Found \"$svol->{PRINT}\" (id=$svol->{node}{id}) in btrfs subtree of: $sroot->{PRINT}";
} else {
ABORTED($svol, "Not a child subvolume of: $sroot->{PRINT}");