From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07FDFC2B9F7 for ; Wed, 26 May 2021 07:52:35 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CB3DA61437 for ; Wed, 26 May 2021 07:52:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB3DA61437 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3A57582AF4; Wed, 26 May 2021 09:52:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id C8DF782B2A; Wed, 26 May 2021 09:52:29 +0200 (CEST) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3BDD681D48 for ; Wed, 26 May 2021 09:52:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=miquel.raynal@bootlin.com Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 1B5F44000B; Wed, 26 May 2021 07:52:25 +0000 (UTC) Date: Wed, 26 May 2021 09:52:24 +0200 From: Miquel Raynal To: Joao Marcos Costa Cc: u-boot@lists.denx.de, thomas.petazzoni@bootlin.com, richard.genoud@posteo.net Subject: Re: [PATCH] fs/squashfs: fix reading of fragmented files Message-ID: <20210526095224.17f2e3f8@xps13> In-Reply-To: <20210517212038.117284-1-jmcosta944@gmail.com> References: <20210517212038.117284-1-jmcosta944@gmail.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean Hi Joao, Joao Marcos Costa wrote on Mon, 17 May 2021 18:20:38 -0300: > The fragmented files were not correctly read because of two issues: >=20 > - The squashfs_file_info struct has a field named 'comp', which tells if > the file's fragment is compressed or not. This field was always set to > 'true' in sqfs_get_regfile_info and sqfs_get_lregfile_info. It should > actually take sqfs_frag_lookup's return value. This patch addresses > these two assignments. >=20 > - In sqfs_read, the fragments (compressed or not) were copied to the > output buffer through a for loop which was reading data at the wrong > offset. Replace these loops by equivalent calls to memcpy, with the > right parameters. Good idea to get rid of these memcpy of 1 byte :) > I tested this patch by comparing the MD5 checksum of a few fragmented > files with the respective md5sum output in sandbox, considering both > compressed and uncompressed fragments. >=20 > Signed-off-by: Joao Marcos Costa Reviewed-by: Miquel Raynal But next time, when you fix two issues (even if they fix the same feature) please provide two patches ;) Thanks, Miqu=C3=A8l