From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 1D8421FF0AA for ; Tue, 17 Nov 2026 16:28:37 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 9379B21677; Tue, 17 Nov 2026 16:28:34 +0100 (CET) From: Christian Ebner To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox-backup 05/10] bin: debug: fix off-by-one error in last chunk lookup Date: Tue, 17 Nov 2026 16:28:09 +0100 Message-ID: <20261117152814.491323-6-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261117152814.491323-1-c.ebner@proxmox.com> References: <20261117152814.491323-1-c.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794929311035 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.372 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: I7W7N5HIFENCIBWFLVOPOORIGMGN6NUL X-Message-ID-Hash: I7W7N5HIFENCIBWFLVOPOORIGMGN6NUL X-MailFrom: c.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The end of a range as stored in pxar's EntryRangeInfo is exclusive, which means this can potentially point already to the start offset of the next chunk if the underlying chunk boundary is aligned by chance. Therefore, assure to exclude that chunk when looking up the last chunk needed to cover the range. Signed-off-by: Christian Ebner --- src/bin/proxmox_backup_debug/diff.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/proxmox_backup_debug/diff.rs b/src/bin/proxmox_backup_debug/diff.rs index 9cfbcddb6..a6e12f3d8 100644 --- a/src/bin/proxmox_backup_debug/diff.rs +++ b/src/bin/proxmox_backup_debug/diff.rs @@ -356,7 +356,7 @@ fn visit_directory<'f, 'c>( .context("Invalid offset")? .chunk_pos; let last_chunk = index - .chunk_from_offset(range.end) + .chunk_from_offset(range.end - 1) .context("Invalid offset")? .chunk_pos; -- 2.47.3