[LU-15038] mgc_fs_setup() can leak cl_mgc_mutex reference Created: 27/Sep/21  Updated: 22/Oct/21  Resolved: 10/Oct/21

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.15.0

Type: Bug Priority: Minor
Reporter: Andreas Dilger Assignee: Andreas Dilger
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Duplicate
is duplicated by LU-6554 missing mutex unlock in mgc_fs_setup() Resolved
Related
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

It is possible for mgc_fs_setup() to leak a reference to cl_mgc_mutex if local_oid_storage_init() fails:

        /* The mgc fs exclusion mutex. Only one fs can be setup at a time. */
        mutex_lock(&cli->cl_mgc_mutex); 
        
        /* Setup the configs dir */
        fid.f_seq = FID_SEQ_LOCAL_NAME;
        fid.f_oid = 1;
        fid.f_ver = 0;
        rc = local_oid_storage_init(env, lsi->lsi_dt_dev, &fid,
                                    &cli->cl_mgc_los);
        if (rc)
                RETURN(rc);


 Comments   
Comment by Gerrit Updater [ 27/Sep/21 ]

"Andreas Dilger <adilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/45063
Subject: LU-15038 mgc: release cl_mgc_mutex on error
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 1389ac82ad805b411bf4b063fb9469cf8c496ed2

Comment by Gerrit Updater [ 10/Oct/21 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/45063/
Subject: LU-15038 mgc: release cl_mgc_mutex on error
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 7cf10b90d62256aa4d177486ff13bd61dfb9a5ff

Comment by Peter Jones [ 10/Oct/21 ]

Landed for 2.15

Generated at Sat Feb 10 03:14:55 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.