Whamcloud - gitweb
LU-3321 clio: revert LU-2622 for removing global env list
[fs/lustre-release.git] / lustre / lclient / lcommon_misc.c
index d531507..2ba559e 100644 (file)
@@ -142,10 +142,11 @@ int cl_get_grouplock(struct cl_object *obj, unsigned long gid, int nonblock,
 
        rc = cl_io_init(env, io, CIT_MISC, io->ci_obj);
        if (rc) {
+               cl_io_fini(env, io);
+               cl_env_put(env, &refcheck);
                /* Does not make sense to take GL for released layout */
                if (rc > 0)
                        rc = -ENOTSUPP;
-               cl_env_put(env, &refcheck);
                return rc;
         }