From mboxrd@z Thu Jan 1 00:00:00 1970 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 9B5FAC32793 for ; Wed, 18 Jan 2023 16:00:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 34F2C6B0072; Wed, 18 Jan 2023 11:00:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2FF0E6B0073; Wed, 18 Jan 2023 11:00:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1EE4D6B0074; Wed, 18 Jan 2023 11:00:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 1176D6B0072 for ; Wed, 18 Jan 2023 11:00:47 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B1F95120CCB for ; Wed, 18 Jan 2023 16:00:46 +0000 (UTC) X-FDA: 80368382892.23.EAD2F8E Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf08.hostedemail.com (Postfix) with ESMTP id 82F36160007 for ; Wed, 18 Jan 2023 16:00:41 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=H4jFoXQ9; spf=none (imf08.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674057642; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=GSOq94AXmVvB2t/Hu5/HVPL9U2Xr3S2Gs4mgbP3Jze4=; b=yQBKObg/P+K8mu6fxMFJ//1VQBjnza77L3WmISyXBVWEu3f2H3ll+1lEI8hfHao3YvRACg 7oSd/RPrXYqG921O0OoMzAkry8Woh29XszQT1vAsA9xRACYZzcRtgz9Hb0HKV8w58kbKB8 i7cAnaG2cEtknSyShNxR/UyTwe1PO58= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=H4jFoXQ9; spf=none (imf08.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674057642; a=rsa-sha256; cv=none; b=kAQwnXrNck/2mcXjJxQYlB1E2PLGICqYmCQwJPPqYRk0t3l5VS8ZFyw3WzFIdxgTWucFOj G6JVFI6sb3S8nn8DpqgWi9XacPulh5rLM/i0PtFg+kvMJF6PDXL4wZdIBFUSiTPUXvtzZx 8z5vBw1+PFzn5NsNzzLy5NZAQxcge18= 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=GSOq94AXmVvB2t/Hu5/HVPL9U2Xr3S2Gs4mgbP3Jze4=; b=H4jFoXQ9JNPPdfRtFstnPmrvPm uWOrVD7S7r2C0I7UGlhUvnbnsIczzMh9ht9Oh0scSjoKcjMxXkXI6boL8jWnYcX5zmHYFU70+t16b dN7B/gIGvyDbv0wwI2uVzsQ7PKSchDHzdh9lT9KlZJC7fZHeDWn1sEm8LHv7KH0wT4jLZ+vMGxy+V H2yYWTjNseX7HXyuJ+iNn6aQyEJudOmctSm+1V2Rja3yR7l2qa3gu8ehNTyGzdEfq4GAEGDydDvmd ShS6JHhXe1t92VTzt3aWfQPXYFs/nr0AgLwyTPmVoSrjd/4HITqMfh19kKAiG5w2cMYxZDRIIVlni FN18xZOA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIArZ-0007eO-4K; Wed, 18 Jan 2023 16:00:33 +0000 Date: Wed, 18 Jan 2023 16:00:33 +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 7/9] gfs2: handle a NULL folio in gfs2_jhead_process_page Message-ID: References: <20230118094329.9553-1-hch@lst.de> <20230118094329.9553-8-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230118094329.9553-8-hch@lst.de> X-Stat-Signature: gye7o4zyewhi776agknc17wqx6hxzk6k X-Rspam-User: X-Rspamd-Queue-Id: 82F36160007 X-Rspamd-Server: rspam06 X-HE-Tag: 1674057641-948848 X-HE-Meta: U2FsdGVkX190oz1fLaYUtYOBPqJ1rfNgnPRwT1GnSos8Xw7CPxSW3W4dWAN8MD5N6PK4A6IORymuVtJt+WD+dE41nOZbMPxu/7NNmx+qa/IMDbT2y48qe2KuKediRYtlAZqGLsS2vE17umqVR/XVSbQfAYghyy2mS0lnujtqtsUU/Lp6TPwRmhkbC3x1GLW7e3oKZGyJt9Z290M2vfwCx99eFLUSPyBi+SN9a7QYNa1TMZB63TkZIXEij/lCUVGAnJbDocjZPv/9vLYbJe+urFduVkdL7MyfYoiSLwc50BjA0hiDIV4bA/abnZ8q6Tv00+JD8l/ZW7WqtFoSWIh5zk0v16lMSMJP6PeofluLSPRu1HIyR6/vmwkTcea4QnIW2LFXTLWUhifvfVOmX4LsHkjqPEtUB8xE/alwONG2svD36OEA9h++WR32fPKcvL/taQWyEYtJYXkirOT7LsCUQwqz+l1Xmyuj3IyyjoM6bxi4/Kh8LSQXhxrRa+h+lPwofNDKre9vsBC6CzVGe1jscPPH6bYjl4vd+DluNqyw8VF0ksA+lcP+Eo+26x1T6jigbJE0c7NrVZFaxTIkadXWeSsQWcOfTfLJwFVJXQFSQULgIRzCtBBZgYNzCLidN8BLfk2VlZg5ECbwd9TMHdOqc1HmFZl0sXZPGs+HD5pMtjU3EuCJRoH9jimaxSu4+bA3HSxcyzAOo90S2q1ZhC8gLUhmbNO15/H0fEwVseWHVyh1LBRkyBUre9fLuySN9OYMI7V+YSIl1LJAV5gVvfIKWatN7f2NfAbGnsWR6ufGt8udexkYiYI35Gpwu1HbF/0gj/RQBAiosuUMArsyLj72K1EvqYRBgtOnTCkuKIMZj7XaEJRSkKm+xz5Zb9FOn64vBFdvccc6TAVnkKPyqVeZCQ== 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: On Wed, Jan 18, 2023 at 10:43:27AM +0100, Christoph Hellwig wrote: > filemap_get_folio can return NULL, so exit early for that case. I'm not sure it can return NULL in this specific case. As I understand this code, we're scanning the journal looking for the log head. We've just submitted the bio to read this page. I suppose memory pressure could theoretically push the page out, but if it does, we're doing the wrong thing by just returning here; we need to retry reading the page. Assuming we're not willing to do the work to add that case, I think I'd rather see the crash in folio_wait_locked() than get data corruption from failing to find the head of the log. > Signed-off-by: Christoph Hellwig > --- > fs/gfs2/lops.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c > index 1902413d5d123e..51d4b610127cdb 100644 > --- a/fs/gfs2/lops.c > +++ b/fs/gfs2/lops.c > @@ -472,6 +472,8 @@ static void gfs2_jhead_process_page(struct gfs2_jdesc *jd, unsigned long index, > struct folio *folio; > > folio = filemap_get_folio(jd->jd_inode->i_mapping, index); > + if (!folio) > + return; > > folio_wait_locked(folio); > if (folio_test_error(folio)) > -- > 2.39.0 >