Release the alloced memory of archive id in mdt_hsm_cdt_cleanup
when free hsm_agent data structure, avoiding memroy leak problem.
Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: I40e5fd289419d7c18d5f2c3ebe0d3955229f5517
Reviewed-on: https://review.whamcloud.com/32456
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Quentin Bouget <quentin.bouget@cea.fr>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
down_write(&cdt->cdt_agent_lock);
list_for_each_entry_safe(ha, tmp2, &cdt->cdt_agents, ha_list) {
list_del(&ha->ha_list);
+ if (ha->ha_archive_cnt != 0)
+ OBD_FREE(ha->ha_archive_id, ha->ha_archive_cnt *
+ sizeof(*ha->ha_archive_id));
OBD_FREE_PTR(ha);
}
up_write(&cdt->cdt_agent_lock);