From patchwork Tue May 23 08:13:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13251831 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 34558C77B75 for ; Tue, 23 May 2023 08:15:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236076AbjEWIPu (ORCPT ); Tue, 23 May 2023 04:15:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236270AbjEWIPU (ORCPT ); Tue, 23 May 2023 04:15:20 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57F19129 for ; Tue, 23 May 2023 01:13:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=C4yUvFKlHSZ5zA3mUqo6HhAQKxoRImKgFZxgmYeGMCg=; b=39UYIIRl4aOmCUPGq5XcnqBAk/ SolilyQNlvyTGgJWcIuC1jsL4cYUE+iQL6T+0x3X4C0YTS3lp2YBylAK9EEeFBB/qgrzg2Lm+OUMY ZsMOysIjSJutSvN3HWQ2IGOddhytLDmlaFmXpuhjyofRFggcDOe7fEyCHcTlaZwnzzgMCKsI1XTjB ah4HgBs6SaTYco9xIIje8ygfVCZl6tZkgpRJtq2NTzVD/5iURlC5dj/KnqhKL7dWVyqnrTVrY8xaW kltAg+6MEsJJgjmJHKtpeDJAkqwUMPDmCWqBVUgphsDgtC6vp1zinjgDWsxAj+PgLCq7EG7VWbsUN w9qt1RXQ==; Received: from [2001:4bb8:188:23b2:6ade:85c9:530f:6eb0] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1q1N95-009OSq-0E; Tue, 23 May 2023 08:13:27 +0000 From: Christoph Hellwig To: Chris Mason , Josef Bacik , David Sterba Cc: linux-btrfs@vger.kernel.org Subject: [PATCH 01/16] btrfs: fix range_end calculation in extent_write_locked_range Date: Tue, 23 May 2023 10:13:07 +0200 Message-Id: <20230523081322.331337-2-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230523081322.331337-1-hch@lst.de> References: <20230523081322.331337-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org The range_end field in struct writeback_control is inclusive, just like the end parameter passed to extent_write_locked_range. Fixes: 771ed689d2cd ("Btrfs: Optimize compressed writeback and reads") Signed-off-by: Christoph Hellwig --- fs/btrfs/extent_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 5999ac3ee601db..c1b0ca94be34e1 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2309,7 +2309,7 @@ int extent_write_locked_range(struct inode *inode, u64 start, u64 end) struct writeback_control wbc_writepages = { .sync_mode = WB_SYNC_ALL, .range_start = start, - .range_end = end + 1, + .range_end = end, .no_cgroup_owner = 1, }; struct btrfs_bio_ctrl bio_ctrl = {