From patchwork Wed Jan 18 09:43:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13105980 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 590FDC32793 for ; Wed, 18 Jan 2023 09:44:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EF29C6B0081; Wed, 18 Jan 2023 04:44:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EA2396B0082; Wed, 18 Jan 2023 04:44:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D92B16B0083; Wed, 18 Jan 2023 04:44:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id CACBE6B0081 for ; Wed, 18 Jan 2023 04:44:23 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id A78CAA079B for ; Wed, 18 Jan 2023 09:44:23 +0000 (UTC) X-FDA: 80367434406.21.7D97EFE Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf13.hostedemail.com (Postfix) with ESMTP id 3BAC320010 for ; Wed, 18 Jan 2023 09:44:22 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=mSCDCWin; spf=none (imf13.hostedemail.com: domain of BATV+aec3eaf5b774c69d00f8+7087+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+aec3eaf5b774c69d00f8+7087+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674035062; a=rsa-sha256; cv=none; b=qOY7vngBR/Q887YjvR7DTlwLwKvLZC7b6vBleFlqb1VGZCan2Eo24m6Cn/sylzEcrZQvTF PFd7ePHkL5woYLNRb/klGzGay0ctV/uaJ5i/MS4+irwUgURTZ8662xoQNQWXGQc+mCqHov jjPf+TtPZdqeOH4tHdRXRJKwqcskZZ0= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=mSCDCWin; spf=none (imf13.hostedemail.com: domain of BATV+aec3eaf5b774c69d00f8+7087+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+aec3eaf5b774c69d00f8+7087+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674035062; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ewY31mbHxOfBtCPdgdKzYjQ0wPkqac5AmSjDkb40tFw=; b=RqbYdrOdDyFZuemGgaPPnyYXG4kDheg+RimlstIcogDgQGsNkC2wnlFLPVJdbeWoSoDzl2 5yp0tnbxn3l8Wogs0OuAh8XWBCEs6n2wxBiT4StTzBqMnLwZxGsM15Mpq4xNt+WgpX443b nt4TmpLPrAN5cRavaztllryeXOzKuZo= 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=ewY31mbHxOfBtCPdgdKzYjQ0wPkqac5AmSjDkb40tFw=; b=mSCDCWinUY/HS19oiHLIYU7HTJ xzmM8Qtfxh3HIuymTISooTmX6MPgoflOa0QEqARdl58+fsr8DnAM2OmWVtGDhwxK56ZTcXRoTQBYc N7fS0PP9RlpPUqBe8Z+JfSMNivMFeCH8O7mEix/D9DJC2FhilwruTYNIfFp2CAtuxiaCqX8cB8ypc i6fXmBJvEW6wRvYpqVZjOFWDrJdIQ7/z/dJm65mWiD83UIjIo8LqP0ZpBFAIe1yPaI115hKSn+ooa r/wDnRGHqtfS0o2zlJoQ8uewHgGSm9sJ9WvQUpk1dqyVo0wKkPBdMHEn+BtUTrCt3neypSrdkLX+J OaMKoOxQ==; Received: from 213-147-167-250.nat.highway.webapn.at ([213.147.167.250] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pI4zN-000ABI-Gv; Wed, 18 Jan 2023 09:44:14 +0000 From: Christoph Hellwig To: Andrew Morton , Matthew Wilcox , Hugh Dickins Cc: 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: [PATCH 8/9] btrfs: handle a NULL folio in extent_range_redirty_for_io Date: Wed, 18 Jan 2023 10:43:28 +0100 Message-Id: <20230118094329.9553-9-hch@lst.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230118094329.9553-1-hch@lst.de> References: <20230118094329.9553-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 X-Rspam-User: X-Rspamd-Queue-Id: 3BAC320010 X-Rspamd-Server: rspam01 X-Stat-Signature: pr755h698p3iigtohqkhti9rhusip13g X-HE-Tag: 1674035062-623845 X-HE-Meta: U2FsdGVkX19pJgelc36f0mGyqXqCBMZkS31c8fwUcU3j6m+4/yR1a2e5KDaKL+S6qaD6stJBgCrAk3/GCoJk0dms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5uF9mYlnLul6qOUrICwU1LvnhCD19R5GsMdcMVGOtZtuuEOY13pbM4MBG4iBba86SA= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: filemap_get_folio can return NULL, skip those cases. 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);