[lustre-devel] [PATCH 13/50] lustre: llite: deadlock in ll_new_node()

James Simmons jsimmons at infradead.org
Sun Mar 20 06:30:27 PDT 2022

From: Lai Siyao <lai.siyao at whamcloud.com>

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 <lai.siyao at whamcloud.com>
Reviewed-on: https://review.whamcloud.com/46157
Reviewed-by: Alex Zhuravlev <bzzz at whamcloud.com>
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
 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,
 		request = NULL;
+		ll_finish_md_op_data(op_data);
+		op_data = NULL;
 		err2 = ll_dir_getstripe(dir, (void **)&lum, &lumsize, &request,
-		ll_finish_md_op_data(op_data);
-		op_data = NULL;
 		if (!err2) {
 			struct lustre_md md = { NULL };

More information about the lustre-devel mailing list