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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2296EC6FD18 for ; Tue, 18 Apr 2023 14:37:50 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EEF09860CF; Tue, 18 Apr 2023 16:36:51 +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="Y+vxVS45"; dkim=pass (2048-bit key) header.d=codewreck.org header.i=@codewreck.org header.b="SPi1S+FE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A9A7785644; Tue, 18 Apr 2023 04:43:38 +0200 (CEST) Received: from nautica.notk.org (ipv6.notk.org [IPv6:2001:41d0:1:7a93::1]) (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 7BF6A85E82 for ; Tue, 18 Apr 2023 04:43: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=asmadeus@codewreck.org Received: by nautica.notk.org (Postfix, from userid 108) id 3DDE2C01C; 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: 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 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.103.8 at phobos.denx.de X-Virus-Status: Clean 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