Whamcloud - gitweb
LU-15038 mgc: release cl_mgc_mutex on error 63/45063/3
authorAndreas Dilger <adilger@whamcloud.com>
Mon, 27 Sep 2021 18:29:58 +0000 (12:29 -0600)
committerOleg Drokin <green@whamcloud.com>
Sun, 10 Oct 2021 03:32:35 +0000 (03:32 +0000)
If local_oid_storage_init() returns an error, the cl_mgc_mutex()
should be released.

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-on: https://review.whamcloud.com/45063
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mgc/mgc_request.c

index 96973e1..000937c 100644 (file)
@@ -797,7 +797,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)
        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)
 
        rc = dt_root_get(env, lsi->lsi_dt_dev, &rfid);
        if (rc)
@@ -836,6 +836,7 @@ out_llog:
 out_los:
        if (rc < 0) {
                local_oid_storage_fini(env, cli->cl_mgc_los);
 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);
        }
                cli->cl_mgc_los = NULL;
                mutex_unlock(&cli->cl_mgc_mutex);
        }