mirror of https://github.com/digint/btrbk
btrbk: related_nodes: add fatal option
parent
e93952b08b
commit
2a1a42e824
8
btrbk
8
btrbk
|
@ -3518,9 +3518,11 @@ sub _related_nodes($;@)
|
||||||
$distance++;
|
$distance++;
|
||||||
}
|
}
|
||||||
if($distance >= $abort_distance) {
|
if($distance >= $abort_distance) {
|
||||||
my $logmsg = "Parent UUID chain exceeds depth=$abort_distance, ignoring related parents of uuid=$uuid for: " . _fs_path($snode);
|
my $logmsg = "Parent UUID chain exceeds depth=$abort_distance" .
|
||||||
|
($opts{fatal} ? " for: " : ", ignoring related parents of uuid=$uuid for: ") . _fs_path($snode);
|
||||||
DEBUG $logmsg;
|
DEBUG $logmsg;
|
||||||
WARN_ONCE $logmsg unless($opts{nowarn});
|
WARN_ONCE $logmsg unless($opts{nowarn});
|
||||||
|
return undef if($opts{fatal});
|
||||||
}
|
}
|
||||||
TRACE "related_nodes: d=$distance uuid=$uuid : top of parent chain" if($do_trace);
|
TRACE "related_nodes: d=$distance uuid=$uuid : top of parent chain" if($do_trace);
|
||||||
|
|
||||||
|
@ -3533,9 +3535,11 @@ sub _related_nodes($;@)
|
||||||
my $children = $parent_uuid_hash->{$uuid};
|
my $children = $parent_uuid_hash->{$uuid};
|
||||||
if($children) {
|
if($children) {
|
||||||
if($distance >= $abort_distance) {
|
if($distance >= $abort_distance) {
|
||||||
my $logmsg = "Parent/child relations exceed depth=$abort_distance, ignoring related children of uuid=$uuid for: " . _fs_path($snode);
|
my $logmsg = "Parent/child relations exceed depth=$abort_distance" .
|
||||||
|
($opts{fatal} ? " for: " : ", ignoring related children of uuid=$uuid for: ") . _fs_path($snode);
|
||||||
DEBUG $logmsg;
|
DEBUG $logmsg;
|
||||||
WARN_ONCE $logmsg unless($opts{nowarn});
|
WARN_ONCE $logmsg unless($opts{nowarn});
|
||||||
|
return undef if($opts{fatal});
|
||||||
} else {
|
} else {
|
||||||
push @nn, { MARK_UUID => $uuid, MARK_DISTANCE => ($distance + 1) }, @$children;
|
push @nn, { MARK_UUID => $uuid, MARK_DISTANCE => ($distance + 1) }, @$children;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue