From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-a4-smtp.messagingengine.com (fhigh-a4-smtp.messagingengine.com [103.168.172.155]) (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 E9DC6305680 for ; Tue, 16 Jun 2026 21:31:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.155 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781645482; cv=none; b=fRlxD1iQi2rO/V3al1HGubN637XYXe/cHsG1V4EZxHD2mQCDkzlSk4buiEj1jDNW1yshf2juvCJoZcT8iwbjlaRboBebEGPm4R8CgC81AeomUmDv7pOP/EoVgu3Cxd07giFKFPe+ZWOK8TorbYQ3eXPW7l4KKxLOLkYQy/51rFY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781645482; c=relaxed/simple; bh=zn2jYVGF39XynkfC5d9ZHAvJ9EpiZz+fJzWTkVIKk3c=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=ATb2PqvC8AdKEW0VE2m7M4koFqUeFb31Mq3da5RlJbecdv/+SvjzJA2vee2OrMR065lC+bNGFGY9fP/dK5RVngXjTzY7XpcixHvF/XrYAMserzfriKmhmQ+UVFWGtOVxoccM/loHwpDQOGbHWn9h26zAgBri9XHiLb5XG1whlbs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b=GfU1iwBy; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=eqM2PPp3; arc=none smtp.client-ip=103.168.172.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b="GfU1iwBy"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="eqM2PPp3" Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 25276140017B; Tue, 16 Jun 2026 17:31:20 -0400 (EDT) Received: from phl-frontend-01 ([10.202.2.160]) by phl-compute-04.internal (MEProxy); Tue, 16 Jun 2026 17:31:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; 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=1781645480; x=1781731880; bh=8pDLEOL4xL s9gXiKEqKXK7EPKPYE5Ye9JqrwBguyQK0=; b=GfU1iwBy/xOg/qqKbZ0cT1AqRO vh40WlnbEGjwYd+M7EO9glAitS5upu5vvZMoAJecLNh4KYChhKcPM0WaVDrBo7c0 M0+v3Lc+ETyhFl1Pu+edEN6OH8eJsaWVmAbK5j3m5FRatKl5sNDr6tQM6879wErY UgW8xm5WQ4ieqz0LLghv2fT85z/wxa70v4OQ+UQN8QEz2aJ9Gz796Z4kuhy6fCJo T7UAX98DqBqN9XYL4ovU53m8o8w90smOCFjSFy08bjaLI9y2XKxfMZ8cTfhBKMnH /f3iy0DFDPgLiSMsir7A8KUMefmUSPji8fAprqL8cjhF0YeCYbj9py15qhMw== 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=fm1; t= 1781645480; x=1781731880; bh=8pDLEOL4xLs9gXiKEqKXK7EPKP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yj8Rdv7/eXDg2YXIPcdKA X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 16 Jun 2026 17:31:19 -0400 (EDT) From: Junio C Hamano To: Pablo Sabater Cc: eric.peijian@gmail.com, chriscool@tuxfamily.org, git@vger.kernel.org, jltobler@gmail.com, karthik.188@gmail.com, toon@iotcl.com, chandrapratap3519@gmail.com Subject: Re: [PATCH GSoC RFC v12 09/12] transport: add client support for object-info In-Reply-To: (Junio C. Hamano's message of "Tue, 16 Jun 2026 13:35:35 -0700") References: <20250221190451.12536-1-eric.peijian@gmail.com> <20260608-ps-eric-work-rebase-v12-0-5338b766e658@gmail.com> <20260608-ps-eric-work-rebase-v12-9-5338b766e658@gmail.com> Date: Tue, 16 Jun 2026 14:31:17 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Junio C Hamano writes: > Pablo Sabater writes: > > [jc: removed recipients from Cc: list whose addresses bounce] > >> From: Calvin Wan >> >> Sometimes, it is beneficial to retrieve information about an object >> without downloading it entirely. The server-side logic for this >> functionality was implemented in commit "a2ba162cda (object-info: >> ... >> diff --git a/fetch-object-info.c b/fetch-object-info.c >> ... >> +int fetch_object_info(const enum protocol_version version, struct object_info_args *args, >> + struct packet_reader *reader, struct object_info *object_info_data, >> + const int stateless_rpc, const int fd_out) >> +{ >> ... >> + for (size_t i = 0; packet_reader_read(reader) == PACKET_READ_NORMAL && i < args->oids->nr; i++) { >> + struct string_list object_info_values = STRING_LIST_INIT_DUP; >> + >> + string_list_split(&object_info_values, reader->line, " ", -1); >> + if (0 <= size_index) { >> + if (!strcmp(object_info_values.items[1 + size_index].string, "")) >> + die("object-info: server does not recognize object %s", >> + object_info_values.items[0].string); >> + >> + if (strtoul_ul(object_info_values.items[1 + size_index].string, 10, object_info_data[i].sizep)) > > > Overly long lines need to be fixed, by using a shorter and crisper > variable name in such a short scope, and line wrapping if needed. > > More importantly, on this line (wrapped): > > if (strtoul_ul(object_info_values.items[1 + size_index].string, > 10, object_info_data[i].sizep)) > > we notice object_info_data[i] is of type "struct object_info", which > is > > struct object_info { > /* Request */ > enum object_type *typep; > size_t *sizep; > off_t *disk_sizep; > ... > > but the last parameter strtoul_ul() takes is unsurprisingly a > pointer to "unsigned long", not a pointer to "size_t". > > Which will break on 32-bit boxes where size_t is "unsigned int" > that is 32-bit and different from "unsigned long". > > Perhaps something along this line? Not quite. This "size_t *sizep" has been very recently introduced by Dscho in a topic that is in-flight. The ps/cat-file-remote-object-info topic alone does not have this type-mismatch problem. Below needs to be addressed as an evil merge at the integration side, so you have nothing to do. I'll have to tweak the merges. Sorry for a false alarm. > diff --git a/fetch-object-info.c b/fetch-object-info.c > index 425929a269..5210e7d954 100644 > --- a/fetch-object-info.c > +++ b/fetch-object-info.c > @@ -75,14 +75,17 @@ int fetch_object_info(const enum protocol_version version, struct object_info_ar > > string_list_split(&object_info_values, reader->line, " ", -1); > if (0 <= size_index) { > + unsigned long sz; > if (!strcmp(object_info_values.items[1 + size_index].string, "")) > die("object-info: server does not recognize object %s", > object_info_values.items[0].string); > > - if (strtoul_ul(object_info_values.items[1 + size_index].string, 10, object_info_data[i].sizep)) > + if (strtoul_ul(object_info_values.items[1 + size_index].string, > + 10, &sz)) > die("object-info: ref %s has invalid size %s", > object_info_values.items[0].string, > object_info_values.items[1 + size_index].string); > + *object_info_data[i].sizep = sz; > } > > string_list_clear(&object_info_values, 0);