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

Re: [PATCH v2 0/5] odb: handle `OBJECT_INFO_DIE_IF_CORRUPT` generically

From
Karthik Nayak <karthik.188@gmail.com>
Date
Aug 20, 2026, 14:14 UTC
Message-ID
<CAOLa=ZTVxdVAJynKjb0LjmZ-+b5nQmyD0Bm-aT81rOOdJ0a5yg@mail.gmail.com>
In-Reply-To
<20260819-pks-odb-generic-corrupt-objects-v2-0-a984e3a0ad6f@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 33 quoted lines
> Hi,
>
> when looking up an object with `OBJECT_INFO_DIE_IF_CORRUPT` fails we
> want to die in case the object exists but is corrupted. This flag is
> handled in two different spots right now:
>
>   - `do_oid_object_info_extended()` calls `has_packed_and_bad()` to
>     check whether the object is known to be corrupt in any packfile.
>     This function reaches into the internals of the packed source and
>     thus breaks the abstraction provided by our object sources.
>
>   - The loose source handles the flag itself and dies directly in
>     `read_object_info_from_path()`, which means that we die even in
>     cases where another source may still have a good copy of the
>     object.
>
> Besides being inconsistent, it also ties us to the specific backend used
> by the database sources because `has_packed_and_bad()` assumes that they
> use the "files" backend. Any other backend will instead cause us to die
> when calling `odb_source_files_downcast()`, even if the object was
> simply nonexistent.
>
> This series fixes these issues and makes the check backend-agnostic by
> extending semantics of `odb_source_read_object_info()`: on the one hand
> it now distinguishes whether an object is missing or corrput, and on the
> other hand it starts to return an error message to the caller.
>
> Changes in v2:
>   - Adapt the series to use an `enum odb_read_status` with negative
>     error codes exclusively, as suggested by Junio. This results in a
>     rather big restructure of the series.
>   - Link to v1: https://patch.msgid.link/20260818-pks-odb-generic-corrupt-objects-v1-0-ec234567510f@pks.im
>
Small questions from me, looks good otherwise! :)
[snip]
Previous: Patrick Steinhardt
Message 15 of 15 in “odb: handle `OBJECT_INFO_DIE_IF_CORRUPT` generically”
  1. 0/5 odb: handle `OBJECT_INFO_DIE_IF_CORRUPT` genericallyPatrick Steinhardt, Aug 19, 2026
  2. 1/5 odb/source-packed: flag known-bad objects as corrupt and not missingPatrick Steinhardt, Aug 19, 2026
  3. 2/5 odb/source: introduce error status when reading objectsPatrick Steinhardt, Aug 19, 2026
  4. Karthik NayakAug 20, 2026
  5. Patrick SteinhardtAug 20, 2026
  6. Karthik NayakAug 20, 2026
  7. 3/5 odb/source: let callers discern missing and corrupt objectsPatrick Steinhardt, Aug 19, 2026
  8. Karthik NayakAug 20, 2026
  9. Patrick SteinhardtAug 20, 2026
  10. Karthik NayakAug 20, 2026
  11. Patrick SteinhardtAug 21, 2026
  12. Karthik NayakAug 21, 2026
  13. 4/5 odb/source: allow `read_object_info()` to bubble up error messagesPatrick Steinhardt, Aug 19, 2026
  14. 5/5 odb: handle `OBJECT_INFO_DIE_IF_CORRUPT` genericallyPatrick Steinhardt, Aug 19, 2026
  15. Karthik NayakAug 20, 2026

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.