infra: allow recursion on backward pass

This commit is contained in:
Thomas Schoebel-Theuer 2020-02-23 17:15:15 +01:00
parent 54a22959e5
commit cd3ceaccdc
1 changed files with 13 additions and 1 deletions

View File

@ -1842,7 +1842,19 @@ int _op_backward(struct say_channel **say_channel,
brick_yield();
bind_to_dent(dent, say_channel);
if (say_channel)
bind_to_dent(dent, say_channel);
/* Caution: the order is important.
* When running backwards, we first need to
* descend into the subtree (when present)
* before visiting the parent.
*/
if (dent->d_subtree)
total_status |=
_op_backward(NULL,
dent->d_subtree,
worker, buf);
status = worker(buf, dent, false, true);
down_read(&global->dent_mutex);