From patchwork Mon Mar 4 06:31:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 10837369 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B68FB1399 for ; Mon, 4 Mar 2019 06:35:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A06B4289BC for ; Mon, 4 Mar 2019 06:35:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94C9229D79; Mon, 4 Mar 2019 06:35:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 446BC289BC for ; Mon, 4 Mar 2019 06:35:29 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 0C8A0682928; Sun, 3 Mar 2019 22:35:29 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id A0E8A6828A6 for ; Sun, 3 Mar 2019 22:35:26 -0800 (PST) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id BF5D0AD33; Mon, 4 Mar 2019 06:35:25 +0000 (UTC) From: NeilBrown To: Andreas Dilger , James Simmons , Oleg Drokin Date: Mon, 04 Mar 2019 17:31:38 +1100 Message-ID: <155168109879.31333.7022820693993444765.stgit@noble.brown> In-Reply-To: <155168107971.31333.14345309795939467246.stgit@noble.brown> References: <155168107971.31333.14345309795939467246.stgit@noble.brown> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Subject: [lustre-devel] [PATCH 20/28] lustre: lov: use GFP_NOFS to allocate lo_entries. X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" X-Virus-Scanned: ClamAV using ClamSMTP lo_type_guard is taken during memory reclaim: -> #0 (&lov->lo_type_guard){++++}: [ 576.552501] down_read+0x27/0x7c [ 576.553072] lov_object_delete+0xd5/0x1bb [ 576.553836] lu_object_free+0x5f/0x111 [ 576.554524] lu_object_put+0x313/0x337 [ 576.555267] cl_inode_fini+0x158/0x1ac [ 576.555898] ll_delete_inode+0xcc/0xd5 [ 576.556572] evict+0xb4/0x166 [ 576.557162] dispose_list+0x30/0x34 [ 576.557834] prune_icache_sb+0x55/0x73 [ 576.558465] super_cache_scan+0x122/0x16d [ 576.559138] shrink_slab.part.22.constprop.37+0x27b/0x414 [ 576.560059] shrink_node+0x8d/0x1b3 and lov_init_composite is called while lo_type_guard is held: [ 576.540707] lov_init_composite+0xff/0xc5f [ 576.541496] lov_conf_set+0x4cf/0x658 [ 576.542179] cl_conf_set+0x49/0x58 [ 576.542790] cl_file_inode_init+0x21a/0x2b8 [ 576.543564] ll_update_inode+0x4e/0xea5 [ 576.544277] ll_iget+0x112/0x1bf [ 576.544871] ll_prep_inode+0x242/0x43d [ 576.545541] ll_lookup_it_finish+0xcf/0x51d [ 576.546308] ll_lookup_it+0x52e/0x5fc [ 576.546976] ll_atomic_open+0x1ce/0x74f [ 576.547666] lookup_open+0x298/0x526 [ 576.548325] path_openat+0x29a/0x7d3 [ 576.548917] do_filp_open+0x57/0xc1 [ 576.549539] do_sys_open+0x137/0x1e7 so it is not safe to use GFP_KERNEL in lov_init_composite(). Use GFP_NOFS instead. Signed-off-by: NeilBrown --- drivers/staging/lustre/lustre/lov/lov_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c b/drivers/staging/lustre/lustre/lov/lov_object.c index 2058275d1cdc..eee89ce97703 100644 --- a/drivers/staging/lustre/lustre/lov/lov_object.c +++ b/drivers/staging/lustre/lustre/lov/lov_object.c @@ -302,7 +302,7 @@ static int lov_init_composite(const struct lu_env *env, struct lov_device *dev, comp->lo_entry_count = entry_count; comp->lo_entries = kcalloc(entry_count, sizeof(*comp->lo_entries), - GFP_KERNEL); + GFP_NOFS); if (!comp->lo_entries) return -ENOMEM;