From: Alex Zhuravlev Date: Tue, 24 Dec 2024 08:15:47 +0000 (+0300) Subject: LU-10375 ptlrpc: fix error handling after tx creation X-Git-Tag: 2.16.52~25 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=9a8b98855e7dbe067a3fe753382ca399c5c372de;p=fs%2Flustre-release.git LU-10375 ptlrpc: fix error handling after tx creation we don't need to stop a transaction if it wasn't created (i.e. if dt_trans_create() returned an error). Fixes: 928714ddda ("LU-5092 nodemap: save id maps to targets in new index file") Signed-off-by: Alex Zhuravlev Change-Id: I04a707ab068ff1278c891cd1c7646ec37cac0055 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57583 Tested-by: Maloo Tested-by: jenkins Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin Reviewed-by: Andreas Dilger --- diff --git a/lustre/ptlrpc/nodemap_storage.c b/lustre/ptlrpc/nodemap_storage.c index 7c39623..31a02ce 100644 --- a/lustre/ptlrpc/nodemap_storage.c +++ b/lustre/ptlrpc/nodemap_storage.c @@ -318,9 +318,8 @@ static int nodemap_idx_insert(const struct lu_env *env, BUILD_BUG_ON(sizeof(union nodemap_rec) != 32); th = dt_trans_create(env, dev); - if (IS_ERR(th)) - GOTO(out, rc = PTR_ERR(th)); + RETURN(PTR_ERR(th)); rc = dt_declare_insert(env, idx, (const struct dt_rec *)nr, @@ -359,9 +358,8 @@ static int nodemap_idx_update(const struct lu_env *env, int rc = 0; th = dt_trans_create(env, dev); - if (IS_ERR(th)) - GOTO(out, rc = PTR_ERR(th)); + RETURN(PTR_ERR(th)); rc = dt_declare_delete(env, idx, (const struct dt_key *)nk, th); if (rc != 0) @@ -410,9 +408,8 @@ static int nodemap_idx_delete(const struct lu_env *env, int rc = 0; th = dt_trans_create(env, dev); - if (IS_ERR(th)) - GOTO(out, rc = PTR_ERR(th)); + RETURN(PTR_ERR(th)); rc = dt_declare_delete(env, idx, (const struct dt_key *)nk, th); if (rc != 0)