Whamcloud - gitweb
LU-15038 mgc: release cl_mgc_mutex on error
authorAndreas Dilger <adilger@whamcloud.com>
Mon, 27 Sep 2021 18:29:58 +0000 (12:29 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 22 Oct 2021 16:46:59 +0000 (16:46 +0000)
If local_oid_storage_init() returns an error, the cl_mgc_mutex()
should be released.

Lustre-change: https://review.whamcloud.com/45063
Lustre-commit: 7cf10b90d62256aa4d177486ff13bd61dfb9a5ff

Fixes: 3e38436dc09 ("LU-2059 llog: MGC to use OSD API for backup logs")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I921dde4e9202733874d8e7f980e95af23739a655
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/45330
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/mgc/mgc_request.c

index 00ee152..772a9cc 100644 (file)
@@ -795,7 +795,7 @@ static int mgc_fs_setup(const struct lu_env *env, struct obd_device *obd,
        rc = local_oid_storage_init(env, lsi->lsi_dt_dev, &fid,
                                    &cli->cl_mgc_los);
        if (rc)
-               RETURN(rc);
+               GOTO(out_mutex, rc);
 
        rc = dt_root_get(env, lsi->lsi_dt_dev, &rfid);
        if (rc)
@@ -834,6 +834,7 @@ out_llog:
 out_los:
        if (rc < 0) {
                local_oid_storage_fini(env, cli->cl_mgc_los);
+out_mutex:
                cli->cl_mgc_los = NULL;
                mutex_unlock(&cli->cl_mgc_mutex);
        }