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

Re: [PATCH 2/3] builtin/fsck: fix flags passed to `odb_has_object()`

From
Justin Tobler <jltobler@gmail.com>
Date
Feb 9, 2026, 20:04 UTC
Message-ID
<aYo8QoT2y8s_0itJ@denethor>
In-Reply-To
<20260126-b4-pks-read-object-info-flags-v1-2-e682a003b17c@pks.im>
On 26/01/26 01:17PM, Patrick Steinhardt wrote:
Show 16 quoted lines
> In `mark_object()` we invoke `has_object()` with a value of 1. This is
> somewhat fishy given that the function expects a bitset of flags, so any
> behaviour that this results in is purely coincidental and may break at
> any point in time.
> 
> The call to `has_object()` was originally introduced in 9eb86f41de
> (fsck: do not lazy fetch known non-promisor object, 2020-08-05). The
> intent here was to skip lazy fetches of promisor objects: we have
> already verified that the object is not a promisor object, so if the
> object is missing it indicates a corrupt repository.
> 
> The hardcoded value that we pass maps to `HAS_OBJECT_RECHECK_PACKED`,
> which is probably the intended behaviour: `odb_has_object()` will not
> fetch promisor objects unless `HAS_OBJECT_FETCH_PROMISOR` is passed, but
> we may want to verify that no concurrent process has written the object
> that we're trying to read.

As you mentioned, promisor objects are not fetched unless `HAS_OBJECT_FETCH_PROMISOR` is passed and in this case a flag value of 1 maps only to the `HAS_OBJECT_RECHECK_PACKED` flag. This certainly seems like the intended option.

> Convert the code to use the named flag instead of the the hardcoded
> value.
Makes sense, this patch looks good to me.
-Justin
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 9 of 23 in “Small fixups for `OBJECT_INFO` flags”
  1. 0/3 Small fixups for `OBJECT_INFO` flagsPatrick Steinhardt, Jan 26, 2026
  2. 1/3 builtin/backfill: fix flags passed to `odb_has_object()`Patrick Steinhardt, Jan 26, 2026
  3. Derrick StoleeJan 26, 2026
  4. Junio C HamanoJan 26, 2026
  5. Justin ToblerFeb 9, 2026
  6. Karthik NayakFeb 10, 2026
  7. Karthik NayakFeb 10, 2026
  8. 2/3 builtin/fsck: fix flags passed to `odb_has_object()`Patrick Steinhardt, Jan 26, 2026
  9. Justin ToblerFeb 9, 2026
  10. 3/3 odb: drop gaps in object info flag valuesPatrick Steinhardt, Jan 26, 2026
  11. Junio C HamanoJan 26, 2026
  12. René ScharfeJan 26, 2026
  13. Junio C HamanoJan 26, 2026
  14. Patrick SteinhardtJan 27, 2026
  15. Justin ToblerFeb 9, 2026
  16. Justin ToblerFeb 9, 2026
  17. Junio C HamanoJan 26, 2026
  18. 0/5 Small fixups for `OBJECT_INFO` flagsPatrick Steinhardt, Feb 12, 2026
  19. 1/5 builtin/backfill: fix flags passed to `odb_has_object()`Patrick Steinhardt, Feb 12, 2026
  20. 2/5 builtin/fsck: fix flags passed to `odb_has_object()`Patrick Steinhardt, Feb 12, 2026
  21. 3/5 odb: drop gaps in object info flag valuesPatrick Steinhardt, Feb 12, 2026
  22. 4/5 odb: convert object info flags into an enumPatrick Steinhardt, Feb 12, 2026
  23. 5/5 odb: convert `odb_has_object()` flags into an enumPatrick Steinhardt, Feb 12, 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.