git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] commit-graph: fix corruption during generation v2 upgrade
@ 2022-07-12 23:10 Taylor Blau
  2022-07-12 23:10 ` [PATCH 1/3] t5318: demonstrate commit-graph generation v2 corruption Taylor Blau
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Taylor Blau @ 2022-07-12 23:10 UTC (permalink / raw)
  To: git; +Cc: gitster, derrickstolee, peff, ps, wfc

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/YqD5dgalb9EPnz85@coredump.intra.peff.net/
[2]: https://lore.kernel.org/git/DD88D523-0ECA-4474-9AA5-1D4A431E532A@wfchandler.org/
[3]: https://lore.kernel.org/git/YsS7H4i5DqUZVQ5i@nand.local/

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(-)

-- 
2.37.0.1.g1379af2e9d

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-07-16  0:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-12 23:10 [PATCH 0/3] commit-graph: fix corruption during generation v2 upgrade Taylor Blau
2022-07-12 23:10 ` [PATCH 1/3] t5318: demonstrate commit-graph generation v2 corruption Taylor Blau
2022-07-15  3:15   ` Derrick Stolee
2022-07-15 22:05     ` Taylor Blau
2022-07-16  0:01       ` Junio C Hamano
2022-07-16  0:17         ` Taylor Blau
2022-07-12 23:10 ` [PATCH 2/3] commit-graph: introduce `repo_find_commit_pos_in_graph()` Taylor Blau
2022-07-15  3:17   ` Derrick Stolee
2022-07-12 23:10 ` [PATCH 3/3] commit-graph: fix corrupt upgrade from generation v1 to v2 Taylor Blau
2022-07-13 17:41 ` [PATCH 0/3] commit-graph: fix corruption during generation v2 upgrade Junio C Hamano
2022-07-15  2:02   ` Taylor Blau
2022-07-15  3:20 ` Derrick Stolee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).