Whamcloud - gitweb
LU-10375 ptlrpc: fix error handling after tx creation 83/57583/3
authorAlex Zhuravlev <bzzz@whamcloud.com>
Tue, 24 Dec 2024 08:15:47 +0000 (11:15 +0300)
committerOleg Drokin <green@whamcloud.com>
Sun, 2 Feb 2025 06:28:46 +0000 (06:28 +0000)
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 <bzzz@whamcloud.com>
Change-Id: I04a707ab068ff1278c891cd1c7646ec37cac0055
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57583
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/ptlrpc/nodemap_storage.c

index 7c39623..31a02ce 100644 (file)
@@ -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)