Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp30676pxh; Thu, 7 Apr 2022 13:03:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZeBVuxHPMUftXHSyC5KEyr2UWgjOGtLdXT5wzVF/drvdbiK5Lp17kcrd7JLflStJsquzB X-Received: by 2002:a17:90a:558a:b0:1ca:a819:d2d1 with SMTP id c10-20020a17090a558a00b001caa819d2d1mr17896777pji.126.1649361828232; Thu, 07 Apr 2022 13:03:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649361828; cv=none; d=google.com; s=arc-20160816; b=kDIeC8ABYNeaSW4rHSo7vqtxlnxyStwDZ/J9/yB+TCu6gvwgRzIpu5NKpFOeDeIPFd 3t9AyQR0evRKOc8NdBtHiktiL7VZlgNGOeWRsQwV+DiBzW/6BtfsFbj2mZ5Oca+o6NIM 7ga3UauwoxVpGLcjCoLO8S1uwlKQ8ge8QNdIEqtRnY1hnVD941AJMvLcJnX8dVKxk1le 6u00DQ87BU0nXZ7V1j3QmZh0otAEyQzZhmM4QGCwudKywuW36tEjoVUDkdwzxxdHV4Rw UJS5YzKXggJ6sn5tWnQrX8kl6FXj5EnQzO8dhi/kuTzHzlhQjd+Gr7MH5+7EBvCyQEoL n5Yw== 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 :message-id:date:subject:to:from:dkim-signature; bh=FwfshqrosOyDXvC+txts0NcMF9ZvyxQ/RmQHe4Nvcw0=; b=CfC2jDndXZD/Ujw63GGALoJ5DwC40zLADVzdzGaGI+W3lLAzJ4ZSCHKu7svhehchan tZOxr4NRxNG1SJ5Cnwes4CsTXlMBewXt89YUfUb+CZDUmBlNYwghEPEczWzdDH2iApnc cPJa+4mOAE8RccF0jZMwnrl1UFf5IZsr91zlv1m2l7+RA4MjDoVvfH/z/6PNvNhMreJn ZnScqzWC4ICE/uGzcUpOxSs7FQ6ag2lHP2fWDdYcfg+mdXbfDQZnQX+28LhVC5JOyY+w rap7dYCgoL+suJqij4D/HINL80tOmm0z6ilNT7Kda4BLGJixUunWfhbOOL/UvBHCKpyJ R2bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qYKnYJan; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c6-20020a170902aa4600b00153b2d1655csi510583plr.356.2022.04.07.13.03.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 13:03:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qYKnYJan; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EEA5D2993FB; Thu, 7 Apr 2022 12:28:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241339AbiDGPqw (ORCPT + 99 others); Thu, 7 Apr 2022 11:46:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345124AbiDGPqh (ORCPT ); Thu, 7 Apr 2022 11:46:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69C00C6B62 for ; Thu, 7 Apr 2022 08:44:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3B88361B8E for ; Thu, 7 Apr 2022 15:44:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 360B0C385A4 for ; Thu, 7 Apr 2022 15:44:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649346271; bh=/0aHu6lQWcAuZqBeYBDiYAEFbo9Ggxhgm5iutTtf7Hk=; h=From:To:Subject:Date:From; b=qYKnYJanVtcfqhnzZeYHI9yooQlV4P5G8MF4Z+LvHr7ElsKVJptnFjzQvSczF7Zox GqEDKhAXLm71tu7fCsb1Y7FM73hP2IfAvGpbcFmo9HcxCYGNEwl5Q0XvHyUfWUItLq SHFLEX+1gJICoc256z78/ZV38y86O1Ve9BUKRBqO4kQPpTa/Sbksi0sxVQ1WW/POFt BLfn+pS+vuP/rsot3KnoWr+NGIIRpeWTSHmULA26u1Ow/3EdrBI8JOGo4N4VvhcYIk 4HKztlW4moxBdnt2dJJldX+bWpWKJmFKrWrDy5CzzSYBh9AXag8kMiMbsgG2cjlQ9H tong+VUSJfnCQ== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Subject: [PATCH 1/7] NFSv4.2: Fix missing removal of SLAB_ACCOUNT on kmem_cache allocation Date: Thu, 7 Apr 2022 11:38:03 -0400 Message-Id: <20220407153809.1053261-1-trondmy@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_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 From: Muchun Song The commit 5c60e89e71f8 ("NFSv4.2: Fix up an invalid combination of memory allocation flags") has stripped GFP_KERNEL_ACCOUNT down to GFP_KERNEL, however, it forgot to remove SLAB_ACCOUNT from kmem_cache allocation. It means that memory is still limited by kmemcg. This patch also fix a NULL pointer reference issue [1] reported by NeilBrown. Link: https://lore.kernel.org/all/164870069595.25542.17292003658915487357@noble.neil.brown.name/ [1] Fixes: 5c60e89e71f8 ("NFSv4.2: Fix up an invalid combination of memory allocation flags") Fixes: 5abc1e37afa0 ("mm: list_lru: allocate list_lru_one only when needed") Reported-by: NeilBrown Signed-off-by: Muchun Song Signed-off-by: Trond Myklebust --- fs/nfs/nfs42xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/nfs42xattr.c b/fs/nfs/nfs42xattr.c index ad3405c64b9e..e7b34f7e0614 100644 --- a/fs/nfs/nfs42xattr.c +++ b/fs/nfs/nfs42xattr.c @@ -997,7 +997,7 @@ int __init nfs4_xattr_cache_init(void) nfs4_xattr_cache_cachep = kmem_cache_create("nfs4_xattr_cache_cache", sizeof(struct nfs4_xattr_cache), 0, - (SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD|SLAB_ACCOUNT), + (SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD), nfs4_xattr_cache_init_once); if (nfs4_xattr_cache_cachep == NULL) return -ENOMEM; -- 2.35.1