Whamcloud - gitweb
LU-12436 lov: return error if cl_env_get fails 60/38360/2
authorShaun Tancheff <stancheff@cray.com>
Thu, 13 Jun 2019 22:51:38 +0000 (17:51 -0500)
committerOleg Drokin <green@whamcloud.com>
Fri, 1 May 2020 04:33:38 +0000 (04:33 +0000)
When cl_env_get() fails with an error return the error.

Lustre-change: https://review.whamcloud.com/35229
Lustre-commit: a7997c836bbfe2a0674007f1c23b9593e596e0ba

Test-Parameters: trivial
Cray-bug-id: LUS-7310
Signed-off-by: Shaun Tancheff <stancheff@cray.com>
Change-Id: Ia065aeb142a772f4d620b84111af423e27c06b90
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/38360
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/lov/lov_io.c

index 77c4fe9..dbb627a 100644 (file)
@@ -122,8 +122,10 @@ static int lov_io_sub_init(const struct lu_env *env, struct lov_io *lio,
 
        /* obtain new environment */
        sub->sub_env = cl_env_get(&sub->sub_refcheck);
-       if (IS_ERR(sub->sub_env))
+       if (IS_ERR(sub->sub_env)) {
                result = PTR_ERR(sub->sub_env);
+               RETURN(result);
+       }
 
        sub_obj = lovsub2cl(lov_r0(lov, index)->lo_sub[stripe]);
        sub_io  = &sub->sub_io;