Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2823306pxm; Mon, 28 Feb 2022 06:48:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxeO3X0nA+6ligpLPP4KF05wxWLYR1qcuQrdt0F9puCzUUbYDC0oqQkyTnf+dJQ/07ZgOTd X-Received: by 2002:a50:d0db:0:b0:413:4475:ac5d with SMTP id g27-20020a50d0db000000b004134475ac5dmr19623551edf.76.1646059736227; Mon, 28 Feb 2022 06:48:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646059736; cv=none; d=google.com; s=arc-20160816; b=kymwSvlb0Wrvl2WZaiKH43QJEo11GDaWtSSkeP4VgKjLuImC5n/B2PmyFQvkjJvh86 2z5vKIBI8nnJM+bRsNSNHvZA3jRiboL4B5yOansXYVkZ4RoGTg/URwkuRPT7ES064wx7 3EzxEHosMfhK0Oqq+tUZeokG3BA84CYQ3ey6KB18TXbW/c7lN6bs70nAkn/wRWwEE0Hw OmFHqKBPDkK47j7ZtZ7bget5Nkx+6bHbjtQacAypEWsPD+v8NgZkDRHuXRAMlg7mNuYP 264tGUYs8kZ458z9PkVKj2kohSQYdgnVjXRJMIWlDIksej8WgKpsD6GlGsByJIcQ0cbo +YFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7RQGHmSpLUsBWZUQYPpcdOjVs87EIcOAL9fVyXOtIRQ=; b=KAnOBi7j7kOIUh8Y1QG1Y+qT8/mKFbI0haDWbGk6KaPwB2xSVC3q0bf63qBAJZ+nrU zCZkMRBBVLP15scM4NDwQmQLlz8SSXpL+y7mGRL1yI943NwpHjiTnsyLc97xMWbmhCGR PoUhIikeFRicCHBUWRQ/ncbRYHfNfED1U+xtTl2LwVpmBgmNY3dswprR/dbKykrVBbN4 /3+0hZKjcdcoGVSiPgyNEktoLTVRI3argjZpxPzmFqncBn7Ef9B6OPXh/EGKqC1csklF Oj29ZKY4IK3SLE6pnFs2XTopZqnE+d6Oz6o9DjAvaXs47idb19Kz2jR5lluVTB4r7MLx ypFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=8OKYvg3u; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cz4-20020a0564021ca400b00413ac18eb6esi2920254edb.483.2022.02.28.06.48.22; Mon, 28 Feb 2022 06:48:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-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=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=8OKYvg3u; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236284AbiB1MX4 (ORCPT + 99 others); Mon, 28 Feb 2022 07:23:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236295AbiB1MXj (ORCPT ); Mon, 28 Feb 2022 07:23:39 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C820155BCD for ; Mon, 28 Feb 2022 04:22:58 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id 12so11260822pgd.0 for ; Mon, 28 Feb 2022 04:22:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7RQGHmSpLUsBWZUQYPpcdOjVs87EIcOAL9fVyXOtIRQ=; b=8OKYvg3uY+0MhQo9Sqp4PHlfDHE8n5JHFkh0d4IPnyiTC0hPfVIt2xxcAbqCQqdjsw 92pF22xqGKb/Zrti0Hx41FWRNgFKxWIH8k7lmpuJTDWGL2jtVtg0hG5Bo1e26N00+Pdi Oqc524Bk6FBDUhr6GhV9xxi5TqJ13Igp/dPXx2cSS1lREZebqOGdvplA9VRbeohCo44V YUS5ig1qtXpGqzkxqWdrFWV0UhIkmcderji7aXysd68MOjjHiT4F/keQdesOWTeHVtRY HAO9FL0jJcoSvj/VubwpRqOyoeA/VkFZ3Ltb6A6wxOW19eajDaa8a3cedjQw620HUJ/i hbKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7RQGHmSpLUsBWZUQYPpcdOjVs87EIcOAL9fVyXOtIRQ=; b=xpprcI0v3RY69y2sK9wvWhcfX2rYWoPtjUjT3paZunve3nzVPO+Zcn/EO3H6AiAbrx S3JItGYWaAZtMzF6nXK6Qe3l9H3YUdNBshO6sM/daUwO1wypybgrQf/fi2zD/02afN/Z TjbzeuhXJuNP/vWTvTKJorBM4HLdrD5JGOAZF/ni9CFD+zvQnROnpKW49INQ4hZFcWNL hdBzO326+a8B9cd3FQ+ANKdcUeFZujs/WtBuBPbJAwM4ENKS5zstmOGt2jrAuvYaikPR x9y4CuSPk4kS4TzDPjUMzTOXOdAUQkndrNkF6DnfCHel9BTTUyk8kv7D0+vgiaNAHQhA hTTg== X-Gm-Message-State: AOAM530lH02lEFzXSgNMZuyaS/UMnwAhtbzbHihBsHrWWp5qWFSUe0Gr QFZOsPqbHWJKcUtHFaaDH5lhdg== X-Received: by 2002:a05:6a00:278d:b0:4e1:4534:8801 with SMTP id bd13-20020a056a00278d00b004e145348801mr21153306pfb.78.1646050978317; Mon, 28 Feb 2022 04:22:58 -0800 (PST) Received: from FVFYT0MHHV2J.tiktokcdn.com ([139.177.225.227]) by smtp.gmail.com with ESMTPSA id ep22-20020a17090ae65600b001b92477db10sm10466753pjb.29.2022.02.28.04.22.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 04:22:58 -0800 (PST) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, roman.gushchin@linux.dev, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, jaegeuk@kernel.org, chao@kernel.org, kari.argillander@gmail.com, vbabka@suse.cz Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v6 05/16] f2fs: allocate inode by using alloc_inode_sb() Date: Mon, 28 Feb 2022 20:21:15 +0800 Message-Id: <20220228122126.37293-6-songmuchun@bytedance.com> X-Mailer: git-send-email 2.32.0 (Apple Git-132) In-Reply-To: <20220228122126.37293-1-songmuchun@bytedance.com> References: <20220228122126.37293-1-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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-nfs@vger.kernel.org The inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song Acked-by: Roman Gushchin --- fs/f2fs/super.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index baefd398ec1a..9cc753a3944d 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1345,8 +1345,12 @@ static struct inode *f2fs_alloc_inode(struct super_block *sb) { struct f2fs_inode_info *fi; - fi = f2fs_kmem_cache_alloc(f2fs_inode_cachep, - GFP_F2FS_ZERO, false, F2FS_SB(sb)); + if (time_to_inject(F2FS_SB(sb), FAULT_SLAB_ALLOC)) { + f2fs_show_injection_info(F2FS_SB(sb), FAULT_SLAB_ALLOC); + return NULL; + } + + fi = alloc_inode_sb(sb, f2fs_inode_cachep, GFP_F2FS_ZERO); if (!fi) return NULL; -- 2.11.0