git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/2] pack-objects: fix a pair of MIDX bitmap-related races

From
Taylor Blau <me@ttaylorr.com>
Date
May 13, 2022, 16:23 UTC
Message-ID
<cover.1652458395.git.me@ttaylorr.com>
This series fixes two races related to using multi-pack bitmaps in pack-objects.

The crux of both is that we call `is_pack_valid()` far too late, leaving us in a situation where `pack-objects` committed to using objects from a specific pack in the MIDX bitmap, without having actually opened those packs. So if those packs are removed in the background (e.g., due to a simultaneous repack), any ongoing clones or fetches will see this error message:

    remote: Enumerating objects: 1498802, done.
    remote: fatal: packfile ./objects/pack/pack-$HASH.pack cannot be accessed
    remote: aborting due to possible repository corruption on the remote side.

See 4c08018204 (pack-objects: protect against disappearing packs, 2011-10-14) and bab919bd44 (pack-bitmap: check pack validity when opening bitmap, 2015-03-26) for previous treatment of similar issues.

Taylor Blau (2):
  pack-bitmap: check preferred pack validity when opening MIDX bitmap
  builtin/pack-objects.c: ensure pack validity from MIDX bitmap objects
 builtin/pack-objects.c |  8 ++++++--
 pack-bitmap.c          | 19 +++++++++++++++++--
 2 files changed, 23 insertions(+), 4 deletions(-)
-- 
2.36.1.76.g80c0bcd80e
Next: Taylor Blau
Message 1 of 29 in “pack-objects: fix a pair of MIDX bitmap-related races”
  1. 0/2 pack-objects: fix a pair of MIDX bitmap-related racesTaylor Blau, May 13, 2022
  2. 1/2 pack-bitmap: check preferred pack validity when opening MIDX bitmapTaylor Blau, May 13, 2022
  3. Junio C HamanoMay 13, 2022
  4. Taylor BlauMay 13, 2022
  5. 2/2 builtin/pack-objects.c: ensure pack validity from MIDX bitmap objectsTaylor Blau, May 13, 2022
  6. Jonathan TanMay 13, 2022
  7. Taylor BlauMay 14, 2022
  8. Jonathan TanMay 16, 2022
  9. Taylor BlauMay 14, 2022
  10. Jonathan TanMay 16, 2022
  11. 0/4 pack-objects: fix a pair of MIDX bitmap-related racesTaylor Blau, May 24, 2022
  12. 1/4 pack-bitmap.c: check preferred pack validity when opening MIDX bitmapTaylor Blau, May 24, 2022
  13. Ævar Arnfjörð BjarmasonMay 24, 2022
  14. Taylor BlauMay 24, 2022
  15. Ævar Arnfjörð BjarmasonMay 24, 2022
  16. 2/4 builtin/pack-objects.c: avoid redundant NULL checkTaylor Blau, May 24, 2022
  17. Junio C HamanoMay 24, 2022
  18. Taylor BlauMay 25, 2022
  19. 3/4 builtin/pack-objects.c: ensure included `--stdin-packs` existTaylor Blau, May 24, 2022
  20. Ævar Arnfjörð BjarmasonMay 24, 2022
  21. Taylor BlauMay 24, 2022
  22. Ævar Arnfjörð BjarmasonMay 24, 2022
  23. Junio C HamanoMay 24, 2022
  24. Taylor BlauMay 25, 2022
  25. Victoria DyeMay 26, 2022
  26. Taylor BlauMay 26, 2022
  27. 4/4 builtin/pack-objects.c: ensure pack validity from MIDX bitmap objectsTaylor Blau, May 24, 2022
  28. Junio C HamanoMay 24, 2022
  29. Taylor BlauMay 25, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.