btrbk: fix regression: clear realpath cache on mkdir

On btrbk archive, after creating a directory without dry-run, the
archive target is skipped with "Failed to fetch subvolume detail" due
to caching of realpath.

Regression in btrbk-0.32.0:

    eb69bc883e btrbk: refactor mountinfo
pull/475/head
Axel Burri 2022-05-27 15:00:51 +02:00
parent 4fcbbad802
commit 12f608d828
1 changed files with 2 additions and 0 deletions

2
btrbk
View File

@ -2060,6 +2060,7 @@ sub system_mkdir($)
);
end_transaction("mkdir", defined($ret));
return undef unless(defined($ret));
delete $realpath_cache{$vol->{URL}};
return 1;
}
@ -6040,6 +6041,7 @@ MAIN:
$droot->{node} = $archive_root->{node};
$droot->{NODE_SUBDIR} = $subvol_dir;
$droot->{VINFO_MOUNTPOINT} = $archive_root->{VINFO_MOUNTPOINT};
$realpath_cache{$droot->{URL}} = $droot->{PATH};
}
else {
# after directory is created, try to init again