mirror of
https://github.com/versity/scoutfs.git
synced 2026-04-14 10:57:00 +00:00
Clear roots when retrying due to stale btree blocks.
Before deltas were added this code path was correct, but with deltas we can't just retry this without clearing &root, since it would potentially double count. The condition where this could happen is when there are deltas in several finalized log trees, and we've made progress towards reading some of them, and then encounter a stale btree block. The retry would not clear the collected trees, apply the same delta as was already applied before the retry, and thus double count. Signed-off-by: Auke Kok <auke.kok@versity.com>
This commit is contained in:
@@ -886,8 +886,12 @@ retry_stale:
|
||||
trace_scoutfs_wkic_read_items(sb, key, &start, &end);
|
||||
ret = scoutfs_block_check_stale(sb, ret, &saved, &roots.fs_root.ref, &roots.logs_root.ref);
|
||||
if (ret < 0) {
|
||||
if (ret == -ESTALE)
|
||||
if (ret == -ESTALE) {
|
||||
/* not safe to retry due to delta items, must restart clean */
|
||||
free_item_tree(&root);
|
||||
root = RB_ROOT;
|
||||
goto retry_stale;
|
||||
}
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user