From: Justin Tobler <jltobler@gmail.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/3] builtin/fsck: fix flags passed to `odb_has_object()`
Date: Mon, 9 Feb 2026 14:04:29 -0600 [thread overview]
Message-ID: <aYo8QoT2y8s_0itJ@denethor> (raw)
In-Reply-To: <20260126-b4-pks-read-object-info-flags-v1-2-e682a003b17c@pks.im>
On 26/01/26 01:17PM, Patrick Steinhardt wrote:
> 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
next prev parent reply other threads:[~2026-02-09 20:04 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-26 12:17 [PATCH 0/3] Small fixups for `OBJECT_INFO` flags Patrick Steinhardt
2026-01-26 12:17 ` [PATCH 1/3] builtin/backfill: fix flags passed to `odb_has_object()` Patrick Steinhardt
2026-01-26 20:17 ` Derrick Stolee
2026-01-26 21:07 ` Junio C Hamano
2026-02-09 19:57 ` Justin Tobler
2026-02-10 9:24 ` Karthik Nayak
2026-02-10 9:32 ` Karthik Nayak
2026-01-26 12:17 ` [PATCH 2/3] builtin/fsck: " Patrick Steinhardt
2026-02-09 20:04 ` Justin Tobler [this message]
2026-01-26 12:17 ` [PATCH 3/3] odb: drop gaps in object info flag values Patrick Steinhardt
2026-01-26 16:58 ` Junio C Hamano
2026-01-26 18:02 ` René Scharfe
2026-01-26 18:13 ` Junio C Hamano
2026-01-27 6:29 ` Patrick Steinhardt
2026-02-09 20:32 ` Justin Tobler
2026-02-09 20:18 ` Justin Tobler
2026-01-26 16:28 ` [PATCH 0/3] Small fixups for `OBJECT_INFO` flags Junio C Hamano
2026-02-12 6:59 ` [PATCH v2 0/5] " Patrick Steinhardt
2026-02-12 6:59 ` [PATCH v2 1/5] builtin/backfill: fix flags passed to `odb_has_object()` Patrick Steinhardt
2026-02-12 6:59 ` [PATCH v2 2/5] builtin/fsck: " Patrick Steinhardt
2026-02-12 6:59 ` [PATCH v2 3/5] odb: drop gaps in object info flag values Patrick Steinhardt
2026-02-12 6:59 ` [PATCH v2 4/5] odb: convert object info flags into an enum Patrick Steinhardt
2026-02-12 6:59 ` [PATCH v2 5/5] odb: convert `odb_has_object()` " Patrick Steinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aYo8QoT2y8s_0itJ@denethor \
--to=jltobler@gmail.com \
--cc=git@vger.kernel.org \
--cc=ps@pks.im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.