From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 6A67F1FF15C for ; Wed, 18 Sep 2024 17:01:03 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8DEF637635; Wed, 18 Sep 2024 17:01:11 +0200 (CEST) From: Christian Ebner To: pbs-devel@lists.proxmox.com Date: Wed, 18 Sep 2024 17:00:47 +0200 Message-Id: <20240918150047.485551-1-c.ebner@proxmox.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.024 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH pxar] decoder: fix incorrect accounting for header in payload input X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" Payload entries are separated by headers of type PAYLOAD within the payload stream of split pxar archives, used for consistency checks when accessing the file contents via a reader instance. Commit 5b8204d0 moved these consistency checks, so they only happen when actually accessing the content, thereby drastically improving performance when navigating contents via the metadata archive. The commit however also incorrectly increased the `Decoder`s `payload_consumed` field by the size of the header, in case the file payload has not been accessed by the `content_reader`. As this filed is used to account for consumed bytes while sequentially reading to possibly skip over entries, this leads to incorrectly skipping of bytes in the stream (less than required). The main manifestation being that a pxar extract with provided match pattern failed. Therefore, drop the incorrect accounting of the payload header. Fixes: 5b8204d0 ("decoder: move payload header check for split input") Signed-off-by: Christian Ebner --- Stumbled accorss this one while working on issue 2996. Without this a ``` pxar extract archive.mpxar target --payload-input archive.ppxar --pattern ``` will fail the payload header checks. src/decoder/mod.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/decoder/mod.rs b/src/decoder/mod.rs index 6191627..613ec12 100644 --- a/src/decoder/mod.rs +++ b/src/decoder/mod.rs @@ -299,14 +299,9 @@ impl DecoderImpl { } State::InPayload { offset, - header_checked, .. } => { if self.input.payload().is_some() { - if !header_checked { - // header is only checked if payload has been accessed - self.payload_consumed += size_of::
() as u64; - } // Update consumed payload as given by the offset referenced by the content reader self.payload_consumed += offset; } else { -- 2.39.2 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel