From patchwork Sun Mar 20 13:30:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 12786489 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6E8D8C433EF for ; Sun, 20 Mar 2022 13:31:38 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id E27A121FA17; Sun, 20 Mar 2022 06:31:26 -0700 (PDT) Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id DB17D21CB5B for ; Sun, 20 Mar 2022 06:31:12 -0700 (PDT) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id 15DEEEE0; Sun, 20 Mar 2022 09:31:08 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 13D5BAB; Sun, 20 Mar 2022 09:31:08 -0400 (EDT) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Sun, 20 Mar 2022 09:30:27 -0400 Message-Id: <1647783064-20688-14-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1647783064-20688-1-git-send-email-jsimmons@infradead.org> References: <1647783064-20688-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 13/50] lustre: llite: deadlock in ll_new_node() 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: Lai Siyao , Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Lai Siyao ll_new_node() will call ll_dir_getstripe() to fetch parent default LMV if md_create() returns -EREMOTE, it should call ll_finish_md_op_data() before calling ll_dir_getstripe() because the latter will lock lli_lsm_sem again, which will deadlock. Fixes: 7578c2b576e9a80 ("lustre: ptlrpc: intent_getattr fetches default LMV") WC-bug-id: https://jira.whamcloud.com/browse/LU-15456 Lustre-commit: 1ce2fee3156858e13 ("LU-15456 llite: deadlock in ll_new_node()") Signed-off-by: Lai Siyao Reviewed-on: https://review.whamcloud.com/46157 Reviewed-by: Alex Zhuravlev Reviewed-by: Andreas Dilger Signed-off-by: James Simmons --- fs/lustre/llite/namei.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/lustre/llite/namei.c b/fs/lustre/llite/namei.c index 0683614..1e3a4fd 100644 --- a/fs/lustre/llite/namei.c +++ b/fs/lustre/llite/namei.c @@ -1643,11 +1643,11 @@ static int ll_new_node(struct inode *dir, struct dentry *dchild, ptlrpc_req_finished(request); request = NULL; + ll_finish_md_op_data(op_data); + op_data = NULL; err2 = ll_dir_getstripe(dir, (void **)&lum, &lumsize, &request, OBD_MD_DEFAULT_MEA); - ll_finish_md_op_data(op_data); - op_data = NULL; if (!err2) { struct lustre_md md = { NULL };