Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3462991pxb; Mon, 4 Apr 2022 17:47:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGYD+DIHQMY0gvunJB7G7GBifrn3mpKQ4y8WxtTRnYe42Ir+3r4KyrXl3tYjXhG3rIL2jB X-Received: by 2002:a17:90b:33c8:b0:1c7:443:3fcc with SMTP id lk8-20020a17090b33c800b001c704433fccmr1085532pjb.109.1649119632832; Mon, 04 Apr 2022 17:47:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649119632; cv=none; d=google.com; s=arc-20160816; b=l2m/CWyHYtKQskkxI2HhxPRiv4NjbAxX1rQrcFPpZRoCpTMzw/FFRHZKHttrGxqo6N YjjIlwSRzILyJ7oiKKEkmalBcVNt2/NJ2ZjQCDVIetdQILEdWLESY1oPfLeOjIYAE7wI o5k2JQfcfNC8glgfikggPZ+Rnbl38/CjA3cTzY3uDc9u8KbRHWn4m2WRHkhYa7wJaaNM XFWJpvXjmWZi8TEbQUsHdMlM3tnB2IuiJ1eKdnHo5RVU6g/JHE3Wu34Ff6BS8UiFUGUh a9NZvvFY2lBO0wUn6TAsUXHd76eg8SGOs2f7UTgtCV49zm/U5XZqwTulEzZ0IaMTIG0L 6eUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ox+CsNF8BXFKzWW4f+kvHDIuP+uwLKW8D0wrf9TFMDE=; b=aalbKiWxDxdhbcVsCxna9x4RYQZ0bEXZCOtaoDer7Fq2CKP3gcfH9kGGyGt0FqmsBZ 00AG0bDpbGU79tkGtFx7D7NWFPusxNACth+TWdRc8SQLJ5msu6WOMBv3QfFsu0HWb6mG HAXN/Mp5mObKI5M+Opxv734xSxLFYaboIgfAWsYEvFgMHpuu332saVPkvagpQZZiNGAH uA7Fr9UsCKy4+6Ec/ZIdzhNofE9QESb/XJ/U4mix5ZMifXryTOVorbRNakFZ1eZFI3Q3 yiVK/fU8FczFCRGvxcq8FUP4tz2pmwy7avNso/8b/BahhHraNrcww9C8bzokxNAOXOe0 91zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JtVeH3iz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id m14-20020a056a00080e00b004fade8aabdasi11972143pfk.121.2022.04.04.17.47.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 17:47:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JtVeH3iz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 552F6CBE76; Mon, 4 Apr 2022 16:58:22 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240390AbiCaRAW (ORCPT + 99 others); Thu, 31 Mar 2022 13:00:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238759AbiCaRAU (ORCPT ); Thu, 31 Mar 2022 13:00:20 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BAF510FDA; Thu, 31 Mar 2022 09:58:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 974E1B8218B; Thu, 31 Mar 2022 16:58:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F925C340ED; Thu, 31 Mar 2022 16:58:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648745909; bh=BKvjdCsLv3Ic0I4T8UQJKKMnRKPo6SUNKqirrFu3/C4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JtVeH3izMStBmLto12CoHY4knU6SF4TbKy6AqDSbaWECEbBUP1DE4hLgj/+p4sY42 pw0/AbXsy4aANqylze5HV/8gqhD1JhCrK7OCAejPCmdyFqNGNqMthkz3aAuynVkv18 FNvkKCmTUdVu/sXQmJzSV5iOGiRZU148YVqIfrX8kPM9/nQB47GD77M2+J2hi+8LBc 2gMGB3y3LuFvTHmVm1Y9yxoUiJYnG/3QcCuLl9H6ez5Bur1IBVPC3AHM4O2IPMjvmw 6ULEk5b4jTP6VEIapaGh9Y8M9CCaxNLeObTMgLp3ZblDhgSiPkUBPaC2UTzi+APBst 33VrTfgRN1gQA== Date: Thu, 31 Mar 2022 12:58:28 -0400 From: Sasha Levin To: Omar Sandoval Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Omar Sandoval , Josef Bacik , Nikolay Borisov , David Sterba , clm@fb.com, jbacik@fb.com, linux-btrfs@vger.kernel.org Subject: Re: [PATCH AUTOSEL 5.17 12/21] btrfs: don't advance offset for compressed bios in btrfs_csum_one_bio() Message-ID: References: <20220328194157.1585642-1-sashal@kernel.org> <20220328194157.1585642-12-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 29, 2022 at 12:57:23PM -0700, Omar Sandoval wrote: >On Mon, Mar 28, 2022 at 03:41:47PM -0400, Sasha Levin wrote: >> From: Omar Sandoval >> >> [ Upstream commit e331f6b19f8adde2307588bb325ae5de78617c20 ] >> >> btrfs_csum_one_bio() loops over each filesystem block in the bio while >> keeping a cursor of its current logical position in the file in order to >> look up the ordered extent to add the checksums to. However, this >> doesn't make much sense for compressed extents, as a sector on disk does >> not correspond to a sector of decompressed file data. It happens to work >> because: >> >> 1) the compressed bio always covers one ordered extent >> 2) the size of the bio is always less than the size of the ordered >> extent >> >> However, the second point will not always be true for encoded writes. >> >> Let's add a boolean parameter to btrfs_csum_one_bio() to indicate that >> it can assume that the bio only covers one ordered extent. Since we're >> already changing the signature, let's get rid of the contig parameter >> and make it implied by the offset parameter, similar to the change we >> recently made to btrfs_lookup_bio_sums(). Additionally, let's rename >> nr_sectors to blockcount to make it clear that it's the number of >> filesystem blocks, not the number of 512-byte sectors. >> >> Reviewed-by: Josef Bacik >> Reviewed-by: Nikolay Borisov >> Signed-off-by: Omar Sandoval >> Signed-off-by: David Sterba >> Signed-off-by: Sasha Levin >> --- >> fs/btrfs/compression.c | 2 +- >> fs/btrfs/ctree.h | 2 +- >> fs/btrfs/file-item.c | 37 +++++++++++++++++-------------------- >> fs/btrfs/inode.c | 8 ++++---- >> 4 files changed, 23 insertions(+), 26 deletions(-) > >Hi, Sasha, > >This patch doesn't fix a real bug, so it should be dropped from both >5.16 and 5.17. I'll drop it, thanks. -- Thanks, Sasha