From patchwork Mon Dec 10 00:46:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 10720451 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 0776E112E for ; Mon, 10 Dec 2018 00:47:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA67D29D75 for ; Mon, 10 Dec 2018 00:47:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DEEB229D9D; Mon, 10 Dec 2018 00:47:22 +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 9EB4D29D75 for ; Mon, 10 Dec 2018 00:47:22 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 5ABB821F669; Sun, 9 Dec 2018 16:47:22 -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 C52F521F5C4 for ; Sun, 9 Dec 2018 16:47:20 -0800 (PST) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id C33BDAF31; Mon, 10 Dec 2018 00:47:19 +0000 (UTC) From: NeilBrown To: James Simmons , Oleg Drokin , Andreas Dilger Date: Mon, 10 Dec 2018 11:46:16 +1100 Message-ID: <154440277646.29887.1527233404610585779.stgit@noble> In-Reply-To: <154440246926.29887.1667505755325904791.stgit@noble> References: <154440246926.29887.1667505755325904791.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Subject: [lustre-devel] [PATCH 2/4] lustre: use GFP_NOFS when lli_och_mutex is held - again 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 lockdep reports that lli_och_mutex is involved with fs_reclaim and is held during this memory allocation - so GFP_NOFS should be used to avoid a possible deadlock. This is a second place where this was a problem - I don't think there are more. Fixes: 0b0c8c1ca0bd ("lustre: llite: replace several GFP_NOFS with GFP_KERNEL") Signed-off-by: NeilBrown Signed-off-by: James Simmons Reviewed-by: James Simmons --- drivers/staging/lustre/lustre/llite/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 15910ff5f293..a6f149c47a7a 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -135,7 +135,7 @@ static int ll_close_inode_openhandle(struct inode *inode, goto out; } - op_data = kzalloc(sizeof(*op_data), GFP_KERNEL); + op_data = kzalloc(sizeof(*op_data), GFP_NOFS); /* * We leak openhandle and request here on error, but not much to be * done in OOM case since app won't retry close on error either. @@ -1652,7 +1652,7 @@ int ll_release_openhandle(struct inode *inode, struct lookup_intent *it) LASSERT(it_open_error(DISP_OPEN_OPEN, it) == 0); - och = kzalloc(sizeof(*och), GFP_KERNEL); + och = kzalloc(sizeof(*och), GFP_NOFS); if (!och) { rc = -ENOMEM; goto out;