Message ID | 20230418-btrfs-extent-reads-v1-0-47ba9839f0cc@codewreck.org |
---|---|
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=codewreck.org header.i=@codewreck.org header.a=rsa-sha256 header.s=2 header.b=sR1XTMq1; dkim=pass (2048-bit key) header.d=codewreck.org header.i=@codewreck.org header.a=rsa-sha256 header.s=2 header.b=WkUjdJl/; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q161k4S2xz23tD for <incoming@patchwork.ozlabs.org>; Wed, 19 Apr 2023 00:36:42 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A8CCE86059; Tue, 18 Apr 2023 16:36:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=codewreck.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; secure) header.d=codewreck.org header.i=@codewreck.org header.b="sR1XTMq1"; dkim=pass (2048-bit key) header.d=codewreck.org header.i=@codewreck.org header.b="WkUjdJl/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5EA9785F3F; Tue, 18 Apr 2023 03:17:57 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from nautica.notk.org (nautica.notk.org [91.121.71.147]) (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 C81D38566A for <u-boot@lists.denx.de>; Tue, 18 Apr 2023 03:17:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=codewreck.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=asmadeus@codewreck.org Received: by nautica.notk.org (Postfix, from userid 108) id 5903BC009; Tue, 18 Apr 2023 03:17:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1681780673; bh=dygc0OaokYdVl4wdSabvCKFMHdZhaFuQ6GohbYeH/AE=; h=From:Subject:Date:To:Cc:From; b=sR1XTMq1fYZXsjgGQyRphqPDM76CRron5UkpWVnhDyH+RMytqoZoF6xDO35XvU4il tpYhC5+YzWzNSk/6Aek28OraAr+b4O31UMA6cQrbxgo/iEVLTS81exDkgnEiKLoMKj riFAEPOLTmoZ5jGQjfoc5yFCC2TCVZ05ObwKqi48hQuCIx5+3mpYYw8a8PBbcuzEPC D5jfmDmRPueV26yJCJoP/WYaD6e1SVnLuF39MigcuxTxOaiXYp852lxA/gvBlrlDhU QCSIShxKWxnKRkgExt2IFl/Q3RQPc+fs8wJM2mtPHDYrQvbtUUCQT3+QfafpLgo9aF zKnAv/fyvmNXw== Received: from odin.codewreck.org (localhost [127.0.0.1]) by nautica.notk.org (Postfix) with ESMTPS id B61C6C009; Tue, 18 Apr 2023 03:17:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1681780672; bh=dygc0OaokYdVl4wdSabvCKFMHdZhaFuQ6GohbYeH/AE=; h=From:Subject:Date:To:Cc:From; b=WkUjdJl/NDRvdSxhnbLM74fLDqTjVhwOSrnud5ejfcKNf8PsrCz56CglUh5j+sAlk ZH/Zns9Cl2vLj5Qa9KICZbX8IetB6MkgGrYwuDvzH7ursjY/8FQ08LBBOM/7VzjA9x r3Q93p76CKfekru7BTeHmyitOI2HQsxxkQ58OGFYe0uuOzoaWxyQPGRavgUibMeebN bbXuJ5UcLUcwx9qTqQFYhHLMNPQspqq/xntRAR4CwY20D/0P56Wbh9Q9ynVvVs8ESB J3Zl/ZRbCRz9kl0t4VI9TC8EbDX+NwWrdUitu8DIr85VyerFs3yLzKWNjLBPZAl2SX T0MoQVmt8aWvw== Received: from [127.0.0.2] (localhost [::1]) by odin.codewreck.org (OpenSMTPD) with ESMTP id 0fee24ca; Tue, 18 Apr 2023 01:17:47 +0000 (UTC) From: Dominique Martinet <asmadeus@codewreck.org> Subject: [PATCH U-BOOT 0/3] btrfs: fix and improve read code Date: Tue, 18 Apr 2023 10:17:32 +0900 Message-Id: <20230418-btrfs-extent-reads-v1-0-47ba9839f0cc@codewreck.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAKzvPWQC/x3NsQrCQBCE4VcJW7uQXIKopS+QRiux2OTmzBWeY feQQMi7e7H8GH5mJYNGGF2qlRTfaPGTCppDReMk6QWOvphc7dq6a048ZA3GWDJSZoX4AufDEa0 7i++ohIMYeFBJ47Snb7EM3YdZEeLyf3vQna99f6Pntv0ANukh/YUAAAA= To: =?utf-8?q?Marek_Beh=C3=BAn?= <kabel@kernel.org>, Qu Wenruo <wqu@suse.com> Cc: linux-btrfs@vger.kernel.org, u-boot@lists.denx.de, Dominique Martinet <dominique.martinet@atmark-techno.com> X-Mailer: b4 0.13-dev-f371f X-Developer-Signature: v=1; a=openpgp-sha256; l=1512; i=asmadeus@codewreck.org; h=from:subject:message-id; bh=mVPO3YrnTHdK+F7rWnq8sj2m0J+3a57gdYMc01tQWH0=; b=owEBbQKS/ZANAwAIAatOm+xqmOZwAcsmYgBkPe+7bb8BWYg5sOvPW/NS9yFUITaQ0LZOMCENv FKpF0bAt9uJAjMEAAEIAB0WIQT8g9txgG5a3TOhiE6rTpvsapjmcAUCZD3vuwAKCRCrTpvsapjm cK1BD/9iGP8RvoNvGrLIDLgCu78C5aiHifLNY4dy2Td6+xtpqq6xPtJjciu8NP9aJcJ2RHin6EQ Yb2C4y3kwZytRiypApl4w4lljmYDEba1OogtS0b6vm8LGHp4vS1qO/Kzk2UA2WAielZuM/MFL32 g6Wnt1breARwq/bCNFMTVv9CmFaW2UShMyfQYB66oiVIharriNbAoDvUHy5ZauSA9yHEz1gHDMd Gde3fzH4KSokLeiTTb5qXEuGMYdmigV3Mu8GWcNmoAKpSzb0uPkRg4KyQ2wexRNqM8+0ELjo8wA NwhUP5zte30oplQcQ5PWUXTz69vyo/wtafDZ/gsTIwq/pvD/SopYkRpstqn0yDaurSFIWCFri45 OLQpsJb+1w486XEmm3qeANppBFSd5npzKvpllnOnQSIh1zUBAAXFCBjkTeiztVCrOihTAWRVC6D o2JGIqfLRw0cjCtSFJhCsQAAHlFG6/dNRNXxQ+oFKV4kPKdYbTO3z2Bg43OsBdPsxQ/aIdD/az3 9rGlH9eHlc7kfRK3+qUjlRfHjCziVvBUpOZaLxfpQntzmXWPubxT9iFs2v1ZPTnoMAcaEL4njMR SNgRoR1wCL5ZF8pg8XBJzJyJd5kj9uZtDPea0iQ6GQTPbEdy6ahKBdT+SxnaeWOymycYg3HL1r8 B5robUFgeULnBXA== X-Developer-Key: i=asmadeus@codewreck.org; a=openpgp; fpr=B894379F662089525B3FB1B9333F1F391BBBB00A X-Mailman-Approved-At: Tue, 18 Apr 2023 16:36:34 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean |
Series | btrfs: fix and improve read code | expand |
I'm posting this as a series but this is really three independant patches. The first is a real bug that has made our board unable to boot as it was corrupting the kernel and image CRC validation failed (yay for checksums -- any plan of enabling validation of data checksums too? I see the code is there for metadata already, so it's probably not missing that much, but unfortunately as far as I understand it would only have seen that the extent data was correct and still corrupted the final buffer as it's just an offset error...) The second patch is an opportunistic optimization as I noticed the code behaved differently than before, and there doesn't seem to be a reason the reads couldn't be coalesced. The last patch is just something that looked odd and looks "obviously better" but I'll leave that up to you. Thanks! Link: https://lore.kernel.org/linux-btrfs/20200525063257.46757-1-wqu@suse.com/ [1] Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com> --- Dominique Martinet (3): btrfs: fix offset within btrfs_read_extent_reg() btrfs: btrfs_file_read: allow opportunistic read until the end btrfs: btfs_file_read: zero trailing data if no extent was found fs/btrfs/inode.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) --- base-commit: 5db4972a5bbdbf9e3af48ffc9bc4fec73b7b6a79 change-id: 20230418-btrfs-extent-reads-e2df6e329ad4 Best regards,