From patchwork Wed May 3 15:24:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13230260 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 03096C77B78 for ; Wed, 3 May 2023 15:25:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230336AbjECPZA (ORCPT ); Wed, 3 May 2023 11:25:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230466AbjECPYz (ORCPT ); Wed, 3 May 2023 11:24:55 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C71B59F9 for ; Wed, 3 May 2023 08:24:52 -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=MUp/VGWk63Ke5NGUfu84IC+tO6Ch4/K9lCMcWFxn/2g=; b=UTNSc1r1XNT5I+VTM762N/TV13 5Cu+LWER77vv60X401POIZA6pY7uHkxPJQ/5pfbu0lN/A17ceJnFP01Un9vN7/p+g0peDiE/5Hnbl K2UQ+07I6Uw+KMLvBI1aR4Ktf0EZP7HpX/zEgURCvLydsX4m3UjQA1UkYOe9neg80mJg6Tm6U268K V4jDqLvCKJMpykEwQ0PlKmVaK2KPiVXKA9PgDUbSNpUgi4ocW/I+pUTDsgUqwZy2QF9FLWJP2BFmw qctUr93dOFhI6i7LQMN58USIkFe3oFWI9Qi22fnivyBZoxvPEwHkmx15xEnTHB/QXBWS9VvvfVJxk gglzD6aQ==; Received: from [2001:4bb8:181:617f:7279:c4cd:ae56:e444] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1puELa-004xcx-1P; Wed, 03 May 2023 15:24:50 +0000 From: Christoph Hellwig To: Chris Mason , Josef Bacik , David Sterba Cc: linux-btrfs@vger.kernel.org, Qu Wenruo , Qu Wenruo Subject: [PATCH 02/21] btrfs: fix sub-page error handling in end_bio_subpage_eb_writepage Date: Wed, 3 May 2023 17:24:22 +0200 Message-Id: <20230503152441.1141019-3-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230503152441.1141019-1-hch@lst.de> References: <20230503152441.1141019-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 Call btrfs_page_clear_uptodate instead of ClearPageUptodate to properly manage the uptodate bit for the subpage case. Reported-by: Qu Wenruo Signed-off-by: Christoph Hellwig Reviewed-by: Qu Wenruo --- fs/btrfs/extent_io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 2e0ca7e8138295..07ce8199960b6a 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -1915,7 +1915,8 @@ static void end_bio_subpage_eb_writepage(struct btrfs_bio *bbio) if (bio->bi_status || test_bit(EXTENT_BUFFER_WRITE_ERR, &eb->bflags)) { - ClearPageUptodate(page); + btrfs_page_clear_uptodate(fs_info, page, + eb->start, eb->len); set_btree_ioerr(page, eb); }