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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C99DEC77B75 for ; Tue, 18 Apr 2023 02:43:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230186AbjDRCnl (ORCPT ); Mon, 17 Apr 2023 22:43:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230210AbjDRCnj (ORCPT ); Mon, 17 Apr 2023 22:43:39 -0400 Received: from nautica.notk.org (nautica.notk.org [91.121.71.147]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC3CD44AE for ; Mon, 17 Apr 2023 19:43:37 -0700 (PDT) Received: by nautica.notk.org (Postfix, from userid 108) id 5BC03C01E; Tue, 18 Apr 2023 04:43:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1681785816; bh=NxmyHPijekriopNxvfOCOrCMMhHehRTR4DDzqrywo40=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Y+vxVS45ADyqNGlzArJ6OiR7FUHT99rd+03/Rlo4Ug6ZLOJkqDfI9cPLUU4h7xHIc MiXtX+OXlUpO2TZCtfRglP10ka2/2ZpKKR8XEt9h2PmA3K9ocFaxfI6Qb/eSKJY9BH p77M3Q4FAIyCi5d3qFcv/PnD573Tuhgi9xc7sE7cJ02N2Ck7iyIuRiN913FzbS80Md BvobV3TtxCIMqORPf6Oz1Gcqwe1V3m80Oep/MC9aTIqneCfwJ+j7+1wvuin+70xZkU MZjZksWHvPLDImu6r+/7jmWZda5xMV464GgyVMmTT5yTxZ5NmSE8eIAaY/Ae3/ZPZe c0pwv+LJOWXkA== Received: from odin.codewreck.org (localhost [127.0.0.1]) by nautica.notk.org (Postfix) with ESMTPS id EDBA8C009; Tue, 18 Apr 2023 04:43:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1681785815; bh=NxmyHPijekriopNxvfOCOrCMMhHehRTR4DDzqrywo40=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SPi1S+FE99KVC1B0KjZXe/l/LBSssQ15mHKyYtgdzpoFD5RRa//Z2vyaI7vqLykc7 m9Bnv4B4/Hfah4Kn/u2tzCbIFEJVAqfQGnZGpI5NNGS4/DypO+IDlHu4fG5udDTE5C st1RymzR7d3l4cXFfZKcFpIFs5VztyQOGHcQ1byJzfb0ml+gEewT5BMawMFtGpOFDZ p4p4PR5JRG85lEplEMEU5MVT18KeSKr5JlkTMXyb/5NwvqfXAR3S17SID+dnpkO/yh OAJm91y27+U9rPk8N1pKkLN20d7yiN9nYQEYs4FDKocf9xVgGSCLzaUQA0S59Io5e+ ORpSCJt9qkV5A== Received: from localhost (odin.codewreck.org [local]) by odin.codewreck.org (OpenSMTPD) with ESMTPA id fe51b019; Tue, 18 Apr 2023 02:43:31 +0000 (UTC) Date: Tue, 18 Apr 2023 11:43:16 +0900 From: Dominique Martinet To: Qu Wenruo Cc: Marek =?utf-8?B?QmVow7pu?= , Qu Wenruo , linux-btrfs@vger.kernel.org, u-boot@lists.denx.de, Dominique Martinet Subject: Re: [PATCH U-BOOT 3/3] btrfs: btfs_file_read: zero trailing data if no extent was found Message-ID: References: <20230418-btrfs-extent-reads-v1-0-47ba9839f0cc@codewreck.org> <20230418-btrfs-extent-reads-v1-3-47ba9839f0cc@codewreck.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Qu Wenruo wrote on Tue, Apr 18, 2023 at 10:04:56AM +0800: > > This is a theorical fix only and hasn't been tested on a file that > > actually runs this code path. > > IIRC there is a memset() at the very beginning of btrfs_file_read() to set > the whole dest memory to zero. Right, sorry. I'll drop this and send a new patch that removes the duplicate memset (at "The whole file is a hole" comment) instead as seeing multiple memsets is what made me think it'd be necessary without thinking; that can be done even if we rework the function a bit in later cleanups... -- Dominique Martinet | Asmadeus