Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5704241ybv; Tue, 18 Feb 2020 02:24:06 -0800 (PST) X-Google-Smtp-Source: APXvYqxsUJcvsoP/Fzldqfgdn+/C9dcPQK1U7QpjxLubFuyglbe9axQsCt53D8GIVzXrohHcxAsA X-Received: by 2002:a05:6830:16d8:: with SMTP id l24mr15353762otr.268.1582021445905; Tue, 18 Feb 2020 02:24:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582021445; cv=none; d=google.com; s=arc-20160816; b=GmuYmHv+/15X4aWjHGdyWiVHbif9qMwhZjstwripzQKHjh6BGf1dAqP2kbCV3kAKfB 3WmbmXWZANNV68r7ycGQdukYkNo57VZiRKMvt06yBt7rJMeo1Phj4rCegOGwQ/ll77wZ BIuOVjrpDKCdH7mhGCXpCM0dq95QI89hKDr7uO/CsUGofBf0x5nk6xeFAM8DSRbbnlD2 1t/TB/66C7x9Lsivr6UHcdWHyuaW4ydemNhB6D/idLxJCCw6RCR8yWbiP5f/kBzg1pkZ 6Wr9lRfdn9vgdIlAHeY1JvRq7wSAYucPATwhMw29ze6OUYGJwd8+IWeHe969aOxVh+aO CUbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=/lga67Fc0sly8XtZmfLpdzWRBUrOF62wweVHi98iUO8=; b=W66Rl3FHujGnvlcxnH471RrJ++IQCaO6QDwAg4lhaS0REXWX+8oA1Cl5a/IWFMX/vd dpDMAL8UHnbWvmQEH9LbiWpheb4/S8YV251NrS9n736db6x1byxZ1wa7+Op0qNR6zAo+ +sLzci3iv04tLA3ioqpyz6vElH1uQ3drDGK4562d4IoabUhSkB+HqOVp8U9vY6jPrZ+U h9QRmDByJuDFA9b5yxNTy8UWgGnIOBuAio4MGvj6/DJ4uwJjLWPqfYvRc93gWMFHJ78n M1kdI+SSzRwj7InuRGT+68f9UId2ty+sLua1I8++FsPn7yHvVSZ5sPF/a8SJjR1JD2p0 7akg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11si1554361otf.36.2020.02.18.02.23.53; Tue, 18 Feb 2020 02:24:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726620AbgBRKWj (ORCPT + 99 others); Tue, 18 Feb 2020 05:22:39 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:40682 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726567AbgBRKWj (ORCPT ); Tue, 18 Feb 2020 05:22:39 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 8861CB2F2C87A3264F37; Tue, 18 Feb 2020 18:22:35 +0800 (CST) Received: from szvp000203569.huawei.com (10.120.216.130) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.439.0; Tue, 18 Feb 2020 18:22:28 +0800 From: Chao Yu To: CC: , , , Chao Yu Subject: [PATCH 1/3] f2fs: avoid __GFP_NOFAIL in f2fs_bio_alloc Date: Tue, 18 Feb 2020 18:21:34 +0800 Message-ID: <20200218102136.32150-1-yuchao0@huawei.com> X-Mailer: git-send-email 2.18.0.rc1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.120.216.130] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org __f2fs_bio_alloc() won't fail due to memory pool backend, remove unneeded __GFP_NOFAIL flag in __f2fs_bio_alloc(). Signed-off-by: Chao Yu --- fs/f2fs/data.c | 12 ++++-------- fs/f2fs/f2fs.h | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index baf12318ec64..3a4ece26928c 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -54,17 +54,13 @@ static inline struct bio *__f2fs_bio_alloc(gfp_t gfp_mask, return bio_alloc_bioset(gfp_mask, nr_iovecs, &f2fs_bioset); } -struct bio *f2fs_bio_alloc(struct f2fs_sb_info *sbi, int npages, bool no_fail) +struct bio *f2fs_bio_alloc(struct f2fs_sb_info *sbi, int npages, bool noio) { - struct bio *bio; - - if (no_fail) { + if (noio) { /* No failure on bio allocation */ - bio = __f2fs_bio_alloc(GFP_NOIO, npages); - if (!bio) - bio = __f2fs_bio_alloc(GFP_NOIO | __GFP_NOFAIL, npages); - return bio; + return __f2fs_bio_alloc(GFP_NOIO, npages); } + if (time_to_inject(sbi, FAULT_ALLOC_BIO)) { f2fs_show_injection_info(sbi, FAULT_ALLOC_BIO); return NULL; diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 5316ac3eacdf..65f569949d42 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -3343,7 +3343,7 @@ void f2fs_destroy_checkpoint_caches(void); */ int __init f2fs_init_bioset(void); void f2fs_destroy_bioset(void); -struct bio *f2fs_bio_alloc(struct f2fs_sb_info *sbi, int npages, bool no_fail); +struct bio *f2fs_bio_alloc(struct f2fs_sb_info *sbi, int npages, bool noio); int f2fs_init_bio_entry_cache(void); void f2fs_destroy_bio_entry_cache(void); void f2fs_submit_bio(struct f2fs_sb_info *sbi, -- 2.18.0.rc1