Skip to content

commit-graph: fix corruption during generation v2 upgrade

Taylor Blau git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3t5318: demonstrate commit-graph generation v2 corruptiont/t5318-commit-graph.sh+27 -04 replies
2/3commit-graph: introduce `repo_find_commit_pos_in_graph()`commit-graph.c commit-graph.h+24 -31 reply
3/3commit-graph: fix corrupt upgrade from generation v1 to v2bloom.c t/t5318-commit-graph.sh+6 -60 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by.

PatchWill Chandler
1/3Reproduced-by
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] commit-graph: fix corruption during generation v2 upgrade

This brief series resolves a bug where a commit-graph would become corrupt when upgrading from generation number v1 to v2, as originally reported in [1].

Some speculation occurred as to what might be causing that bug in the thread beginning at [1], until the problem was explained in more detail by Will Chandler in [2].

The crux of the issue, as is described in [2] and [3], is that the commit_graph_data slab is reused for read and write operations involving the commit-graph, leading to situations where data computed in preparation of a write is clobbered by a read of existing data.

The first patch demonstrates the issue, and the second patch prepares to fix it by introducing a helper function. The crux of the issue is described and fixed in the third patch.

[1]: https://lore.kernel.org/git/[email protected]/
[2]: https://lore.kernel.org/git/[email protected]/
[3]: https://lore.kernel.org/git/[email protected]/

Taylor Blau (3):
t5318: demonstrate commit-graph generation v2 corruption
commit-graph: introduce repo_find_commit_pos_in_graph()
commit-graph: fix corrupt upgrade from generation v1 to v2

 bloom.c                 | 10 +++++-----
 commit-graph.c          | 12 +++++++++---
 commit-graph.h          | 15 +++++++++++++++
 t/t5318-commit-graph.sh | 27 +++++++++++++++++++++++++++
 4 files changed, 56 insertions(+), 8 deletions(-)
Signature · 1 line
2.37.0.1.g1379af2e9d