Memory leak was found during interop testing because
nidlist was not freed correctly in function
mgc_apply_recover_logs().
Test-Parameters: testlist=conf-sanity env=ONLY=29 \
serverversion=2.15 clientdistro=el8.10 serverdistro=el8.10 \
mdscount=2 mdtcount=4 ostcount=8
Fixes:
e4d2d4ff74 ("LU-13306 mgc: handle large NID formats")
Signed-off-by: Emoly Liu <emoly@whamcloud.com>
Change-Id: I7a7a1b4b4f3b8c65c7608537e4dca1b9f1b68e77
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56709
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
CDEBUG(D_INFO, "mgc %s: cannot find obdname %s\n",
mgc->obd_name, obdname);
rc = 0;
- /* this is a safe race, when the ost is starting up...*/
- continue;
+ goto free_nids;
}
/* osc.import = "connection=<Conn UUID>::<target instance>" */
bufs.lcfg_buflen));
if (!lcfg) {
rc = -ENOMEM;
+ /* For old NID format case the nidlist was allocated. */
+ if (entry->mne_nid_type == 0)
+ OBD_FREE_PTR_ARRAY(nidlist,
+ entry->mne_nid_count);
break;
}
lustre_cfg_init(lcfg, LCFG_PARAM, &bufs);