From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id BF5321FF168 for ; Tue, 26 Nov 2024 10:37:26 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 558332B4EF; Tue, 26 Nov 2024 10:37:26 +0100 (CET) Date: Tue, 26 Nov 2024 10:36:49 +0100 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox Backup Server development discussion References: <20240918150047.485551-1-c.ebner@proxmox.com> In-Reply-To: <20240918150047.485551-1-c.ebner@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1732613796.h9gwxsmx2k.astroid@yuna.none> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.049 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com, mod.rs] Subject: [pbs-devel] applied: [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" thanks (and also thanks for the reminder!) On September 18, 2024 5:00 pm, Christian Ebner wrote: > 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 > > > _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel