From patchwork Wed Mar 23 15:39:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12789848 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 CCE84C433EF for ; Wed, 23 Mar 2022 15:40:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238090AbiCWPl1 (ORCPT ); Wed, 23 Mar 2022 11:41:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238053AbiCWPl0 (ORCPT ); Wed, 23 Mar 2022 11:41:26 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 898EC29C8D; Wed, 23 Mar 2022 08:39:55 -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:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=3fBdSQ100xHcTSrCs45lHCLpgmg9lIU1s69LGZJCCrw=; b=Qcp+yp+ZH2DjkIeqC6ZDqGrtcP F7/NWPNevkcyYIejSZYUTqB6puAcw5bHBSaP4QUyN/cK1KbMjwr4JKHv5OrvFIEXVbyt1rR1x3MDJ RwH3bDWIy9yjm3eUstE4XGRjrJdGqUVKmdSvJoOJzQErAGLQOva9Ip8RFyL6qItPD2Bsp8lHeMVbl mzeBA+BARA4sGPFjaknpYsmE4cCVNUp+UV5yRotLlUosWK70SjimbrZMhjBJd9Qtkfh7CcQ3FoQDU LUQM061YdN5DUpidBL/FRN9cJovRKvMOSLrdli81rrqBggDqebC2Y61fXMFtpUDCcj4DgeUGPnVC/ C3POyhPw==; Received: from [2001:4bb8:19a:b822:f080:d126:bfe4:c36c] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nX35W-00E9LT-P0; Wed, 23 Mar 2022 15:39:55 +0000 From: Christoph Hellwig To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, Guenter Roeck , Ryusuke Konishi Subject: [PATCH] fs: do not pass __GFP_HIGHMEM to bio_alloc in do_mpage_readpage Date: Wed, 23 Mar 2022 16:39:52 +0100 Message-Id: <20220323153952.1418560-1-hch@lst.de> X-Mailer: git-send-email 2.30.2 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-block@vger.kernel.org The mpage bio alloc cleanup accidentally removed clearing ~GFP_KERNEL bits from the mask passed to bio_alloc. Fix this up in a slightly less obsfucated way that mirrors what iomap does in its readpage code. Fixes: 77c436de01c0 ("mpage: pass the operation to bio_alloc") Reported-by: Guenter Roeck Signed-off-by: Christoph Hellwig Tested-by: Ryusuke Konishi --- fs/mpage.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/mpage.c b/fs/mpage.c index 9ed1e58e8d70b..d465883edf719 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -148,13 +148,11 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args) int op = REQ_OP_READ; unsigned nblocks; unsigned relative_block; - gfp_t gfp; + gfp_t gfp = mapping_gfp_constraint(page->mapping, GFP_KERNEL); if (args->is_readahead) { op |= REQ_RAHEAD; - gfp = readahead_gfp_mask(page->mapping); - } else { - gfp = mapping_gfp_constraint(page->mapping, GFP_KERNEL); + gfp |= __GFP_NORETRY | __GFP_NOWARN; } if (page_has_buffers(page))