Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp445828pxb; Tue, 14 Sep 2021 00:46:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHmuZn6JrgdhvrsCFrcH2abx+88flHn0M5cHR7MXEo11vKSWHphAFScZvN2bvO5vtZtpKU X-Received: by 2002:a17:906:3983:: with SMTP id h3mr17332737eje.249.1631605563635; Tue, 14 Sep 2021 00:46:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631605563; cv=none; d=google.com; s=arc-20160816; b=Q7pP1KxWSz4IE/Qv3xDqtlyDdIW4fV1yrRAY2UfFqy9BO9+71I+ideBK7pw4X1fFin 9oImo3ywqJTurv7Crfyx8WDSphCuMibXQKz+weRzxhvaYX8dcYYwItW05ZwE2qxiZNs6 Vo1cjAPSvMhBrXCajcoASnJdwRXZ5dwjerFzcIX4Ud6a4tiDSP8xq7r3/EEYmWPniauQ i8DWF0zu7cFfbxemaJbOG+VJSjtwGxP+ApNM7BqeEilt8kDIQtcY5I5equRek42YPZoN fy1BELFIMeuRolSd0/t8Gj75XuYSN0SbrywKtChX2VI7E6VkK3ge1UQ6ruHaEKr3GjTx qMIg== 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=LCwWaL4B2Y5pE/9Q4T3Fxn54/Jx/rWqz+WBfjzit2GM=; b=Lw3N8nJRjAdeig+sq702Jrznj73/vF94Yc4n9b8EH6Ybcuv4MTBz49DMrS556EYbOK pglkrKYgbek4QI6P6tWRFDLALcioTxYTi1sS+4b0jCmL2v2aYKO/toG5Sm5ppZDbRgZp EcP2LkZjBR+bQ34JMmc+S6nF/MP2PcdxnRfZdFvwNSAimdR5jE98NpqbEq+KXUgddVR+ /JausQ64FNQvfyGYy7wqyMWfrS9Qm0NJI1UI05I2UIGDyrRT6sJS/OwOWQF9rQcsgIdW QfgMy3BF0NGnwAESDLk1NLVNdnc4EtZc/CDas7p3FEJE84l2md+n0duanXq75mOjEjPj gaNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=mhdStjDO; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r24si9922013eds.399.2021.09.14.00.45.39; Tue, 14 Sep 2021 00:46:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=mhdStjDO; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 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 S236217AbhINHqI (ORCPT + 99 others); Tue, 14 Sep 2021 03:46:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238238AbhINHo6 (ORCPT ); Tue, 14 Sep 2021 03:44:58 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA8D0C0617AF for ; Tue, 14 Sep 2021 00:40:44 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id v2so3691943plp.8 for ; Tue, 14 Sep 2021 00:40:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LCwWaL4B2Y5pE/9Q4T3Fxn54/Jx/rWqz+WBfjzit2GM=; b=mhdStjDOqRSJkQrrdwVXkGXjVKmevOem1ZTDInLWzcmNqeGwJm2VQX19TPsL1zL43f 2AjCb4MH6OoEYJQX14SqSruOEC7quL4zifuPxlcC5/O20YbnwUhTQsLGZKbhTiYZmYqn s5EK2BNREI6iSxwugCEZBG7auTi6fzFAcaFCtqMJL++xHIFJRVmHlFR+mBQLyzgHZZ52 euUtJ4O+jTQu+O3POFpUbqno0ZNkGTI/9nyQtHB/6hwqgAdQBKeYld65ISbzW3G6T6dj Tks3ZyPskug8Q6GTwD1zAbGdXX66xv5Btdi82RVsBeWh1An8m40/rOUxgbluWjdBDhdz JEXA== 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=LCwWaL4B2Y5pE/9Q4T3Fxn54/Jx/rWqz+WBfjzit2GM=; b=0SSKacTe75W0j+nOWlu2e4QMYxpKSBTk3Uj6ABPpK6n9LKe8zfm1zZYNXHpYrzKff7 CVgFNCHGL9aAw+Wdkp3WDX3lqWR70rA6kzlQobnr1sktSJ3VLUQuzgqy3YhWlp4TxgA5 8oyTw8ZjppMqOWKWckoCO/AOwYrAS/rtlOe7DrQ+WY4XZY2LDAoG25kTeOxVhyrcXU82 vzpApTIFFtde1/Vx5G5ThkOzlvFWJ6V8qYMQ0YwxHRlsmfWoD543FByMP1uQmFi7k9Mt qDZgYJpn3qbHMQ0YmVL3zOJQQYURBmGMbfWXxIDMzTbHbHBi5okC8IAYKyHuCHjvUckf WxQQ== X-Gm-Message-State: AOAM5339EpMRh0p4cFzISE7IPssWkSXBjZa6IPZE33g5ZmB30icQX9q0 K56+XEc/UXA8SyvHKUE3RJYAFA== X-Received: by 2002:a17:903:1251:b0:13a:1f5e:20da with SMTP id u17-20020a170903125100b0013a1f5e20damr13984599plh.75.1631605244305; Tue, 14 Sep 2021 00:40:44 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.40.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:40:44 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com 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 v3 65/76] f2fs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:27 +0800 Message-Id: <20210914072938.6440-66-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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 78ebc306ee2b..20e335f50219 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1306,8 +1306,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