From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2EA5C476054 for ; Thu, 20 Aug 2026 14:22:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787235766; cv=none; b=oEhMo/zqt7c/dRrIWtAOxwIElL8x9u1iZBLO4TQ17Wr8Joi8VLTpJHNZVKJntwLMZ9jWdW++4zu/FBwqX1OM67nqS6t0iwfxbq9Q9tdgIiNB0AgInRP6hWSTrZMZfZLHD34q/oGZZs1ue7cO5uTcZ7dLn1BBrjI/jAuSHZfLFs4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787235766; c=relaxed/simple; bh=WFI91h/Xlc/icHjBg9hgNoBiQpNWB6i0lMR4j5ETvEU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fwVBmH+UodPW8KQSspCc8PEkU7fJXE4Aq/2DcDqrWdhymqq+HBWXiLYhSRBZ7wXzd1Pl19Y8K0RGYsI5jGhU+tilOL0e4i2cDhPOnXgHkklCNWWeQVJdhhch4fuHyl4ivZH7VmpUm4OCFJ0dII/fjfXiZP/iT1mexmSMIfciFEE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=QMMdv3Sr; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Dd9ZHOik; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="QMMdv3Sr"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Dd9ZHOik" Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id B37C8EC023E; Thu, 20 Aug 2026 10:22:41 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Thu, 20 Aug 2026 10:22:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1787235761; x=1787322161; bh=6zUt7GMdqf Zp1irEx40lSp6898H271LY+c2+XHiVREY=; b=QMMdv3Sr2rCVyj4ffgNq+gBYp9 ismjHZngOtluKDVuVMmoX8IgY15jKFUPKgKQgSt/H+X1ThHaI98//KD87IyrMQgX C2KYWYRj2ABpizKOm1ihKPEAGLrz17yTcqnLwYasC1h42KlOxPx8kppWGDm0lc9F mOqBeu09+PC30Fd+jGUrTDwB7TiFAfU9mJezHiTz/7ma+3RzjqqDKyMMGYEjGRAW fZHXjOt8ENsTAiO8RHrmhGnJOpACVe9VkC5/jXxtk9rMpCIPdSY+CEQrB428JCEW YF+HiPyhf5+Ne38IzlfAxEfN4pPx7umqP4Ty82YGnazFMr4DlSV+epr3KTQw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1787235761; x=1787322161; bh=6zUt7GMdqfZp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WfxRGGpLmA3nKpE0hjRWBk5bvmCA X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 20 Aug 2026 10:22:40 -0400 (EDT) Received: by mail (OpenSMTPD) with ESMTPSA id 1cb1549a (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 20 Aug 2026 14:22:37 +0000 (UTC) Date: Thu, 20 Aug 2026 16:22:35 +0200 From: Patrick Steinhardt To: Karthik Nayak Cc: git@vger.kernel.org, Junio C Hamano Subject: Re: [PATCH v2 2/5] odb/source: introduce error status when reading objects Message-ID: References: <20260819-pks-odb-generic-corrupt-objects-v2-0-a984e3a0ad6f@pks.im> <20260819-pks-odb-generic-corrupt-objects-v2-2-a984e3a0ad6f@pks.im> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Aug 20, 2026 at 08:41:10AM -0400, Karthik Nayak wrote: > Patrick Steinhardt writes: > > > The `read_object_info()` callback of `struct odb_source` is documented > > to return a negative error code in case reading the object has failed, > > and zero otherwise. This is overly broad though, as there are two very > > different kinds of failures: > > > > - The object may not exist in the source at all. > > > > - The object exists, but reading it has failed, for example because > > its on-disk state is corrupt. > > > > This distinction matters to callers: when an object is corrupt in one > > source we may still find a good copy of it in another source, so we may > > still be able to proceed with a given operation. > > > > But isn't that the same for an object not existing in a source? If it > doesn't exist in one source, we may find a good copy of it in another? Yeah, that paragraph is a bit odd indeed. What I really wanted to say is that the failure mode is different depending on whether the object is found at all: if it's not then we'd fail gracefully, if it is but it's corrupt then we die. > > diff --git a/odb.c b/odb.c > > index caf1d0f542..1b37b26376 100644 > > --- a/odb.c > > +++ b/odb.c > > @@ -696,12 +696,12 @@ static int oid_object_info_convert(struct repository *r, > > return ret; > > } > > > > Here and elsewhere. Shouldn't we explicitly return ODB_READ_OK or > ODB_READ_ERROR instead of relying on implicit conversion? I didn't want to go through the complete callchain to make sure that we explicitly return those values. I think it'd be mostly pointless: the return code convention is established enough, and all callers already return the expected values anyway, even though they're not using the enum now. Patrick