Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6692709rwb; Wed, 18 Jan 2023 08:14:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXsh1gGXaftTQ++I+2lHCN1Fpz3jlmq38GEhHk8h/fPrWJxX4Ene0nJYvW+3sqvz2j+rZw13 X-Received: by 2002:a17:906:474a:b0:7c0:d60b:2883 with SMTP id j10-20020a170906474a00b007c0d60b2883mr7324065ejs.50.1674058498241; Wed, 18 Jan 2023 08:14:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674058498; cv=none; d=google.com; s=arc-20160816; b=C7uqaSL+2MdKVVIvu/hBl9fE6GkznYJbiaTAt1kY0XQDQoyXlwP+QsQr31RIQ+2Myl 7z73OFjaRuvphVgWSZHUsT0/LgQQycRpHeyrbaXMFI4AUkaKOVSzkl1SHTZsIIV9/uWx zh3Fn9u8qcRQWeSvlG81ZbLbIuf3Ske0Hl/GSg/iwb92x9X07rWS4ou/DmnD9QnK4NlD wAjOXQApmjDOtMAL/1T1BY8rCeA8nimBV9Nqp9MRGsR58T5SyWE97EAG0g5XRLzCSNFt Hsr2/iCRIebnmFHCS+vIzAZ6JRISZrXecF+dBfmDX+tT7pAVgCn0YREUa+2AATv5IXdA BOXg== 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=JEUOAZ78kJr603e3fslTqPJIm0KVjgSmMPI95SNsLdQ=; b=gy1vKr2cjQbzakhOhL8UubkbTPwR1joY9Y5arCOvJfufmWVUmKIeeRXjOou6/fTkok JGhxeo/3nHNHPh+FxA+l8Tvh2MjDburPqAWLI4+oz3eOgFZ5QrSrz8OlUaiA3V0KRZML MnlBVSe0awzM943D/1QuSA6u5WXJ/QpwGFbFCCSrsejZn4KoXZa6CcjIfBAbuKxNTpHm oUc+RfR1ZC+38ihdqwq0ATe9pZsACUX6DJpnWoDDRphRFPwCWO6OLOlfLp/E+VdOcLVw qstB2hjuTUNtMhj+1OPrWlPrsEMZ5pJgq900u+5Sm2K8ihAuNMNuS1Iq1Ca5Q4sQa9NM gIIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="jk2OX/GH"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sc28-20020a1709078a1c00b00872236c2754si7646831ejc.223.2023.01.18.08.14.33; Wed, 18 Jan 2023 08:14:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="jk2OX/GH"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230097AbjARQNu (ORCPT + 99 others); Wed, 18 Jan 2023 11:13:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229716AbjARQNY (ORCPT ); Wed, 18 Jan 2023 11:13:24 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03EF0577D3; Wed, 18 Jan 2023 08:09:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=JEUOAZ78kJr603e3fslTqPJIm0KVjgSmMPI95SNsLdQ=; b=jk2OX/GHKt+KDBvU+2AWIJn5ry QSvBl+h/HCaJiHuccrL+v6bRIufcwCTd0eMLPw1XCRpUNlJt2/bfbsfInmdxoeLrYYKHi7OGjLgOO wuAzMNrhOaicl2w+hFj8r+3l6ge4M+Y7Tf9d/yyASO6QxFfm7hHBD4IMTbGeulZC5l3g/Vb+9it3D 94gz2e1P9UT/wh+6QM64zP7CvRhYB7E/w6Ny0qhYYjx+6RUCXFzz5UR2L+8sEsUYqeHN6WfD88L64 9qubXFGDeITGtJyWPF50S62gtex3EBM7lI7TX9PRim5NbcZlyBfkHtyPAoWpa/UQ6WykrPInUoJ3z QYRfXUVg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIAzh-0007zm-8H; Wed, 18 Jan 2023 16:08:57 +0000 Date: Wed, 18 Jan 2023 16:08:57 +0000 From: Matthew Wilcox To: Christoph Hellwig Cc: Andrew Morton , Hugh Dickins , linux-afs@lists.infradead.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, cluster-devel@redhat.com, linux-mm@kvack.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-nilfs@vger.kernel.org Subject: Re: [PATCH 8/9] btrfs: handle a NULL folio in extent_range_redirty_for_io Message-ID: References: <20230118094329.9553-1-hch@lst.de> <20230118094329.9553-9-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230118094329.9553-9-hch@lst.de> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham 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-ext4@vger.kernel.org On Wed, Jan 18, 2023 at 10:43:28AM +0100, Christoph Hellwig wrote: > filemap_get_folio can return NULL, skip those cases. Hmm, I'm not sure that's true. We have one place that calls extent_range_redirty_for_io(), and it previously calls extent_range_clear_dirty_for_io() which has an explicit BUG_ON(!page); /* Pages should be in the extent_io_tree */ so I'm going to say this one can't happen either. I haven't delved far enough into btrfs to figure out why it can't happen. > Signed-off-by: Christoph Hellwig > --- > fs/btrfs/extent_io.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c > index d55e4531ffd212..a54d2cf74ba020 100644 > --- a/fs/btrfs/extent_io.c > +++ b/fs/btrfs/extent_io.c > @@ -230,6 +230,8 @@ void extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end) > > while (index <= end_index) { > folio = filemap_get_folio(mapping, index); > + if (!folio) > + continue; > filemap_dirty_folio(mapping, folio); > folio_account_redirty(folio); > index += folio_nr_pages(folio); > -- > 2.39.0 >