This problem is easy to produce:
With following patch:
memset(&start, 0, sizeof(start));
start.tc_jobids_str = "*";
start.tc_rpc_rate = tbf_rate;
start.tc_rule_flags = NTRS_DEFAULT;
start.tc_name = NRS_TBF_DEFAULT_RULE;
INIT_LIST_HEAD(&start.tc_jobids);
//rc = nrs_tbf_rule_start(policy, head, &start);
rc = -EINVAL;
return rc;
[root@QYJ tests]# lctl set_param ost.OSS.ost_io.nrs_policies="tbf jobid"
ost.OSS.ost_io.nrs_policies=tbf jobid
error: set_param: setting /proc/fs/lustre/ost/OSS/ost_io/nrs_policies=tbf jobid: Invalid argument
[root@QYJ tests]# sh llmountcleanup.sh
Stopping clients: QYJ /mnt/lustre (opts:-f)
Stopping client QYJ /mnt/lustre opts:-f
Stopping clients: QYJ /mnt/lustre2 (opts:-f)
Stopping /mnt/mds1 (opts:-f) on QYJ
Stopping /mnt/ost1 (opts:-f) on QYJ
Stopping /mnt/ost2 (opts:-f) on QYJ
LNetError: 19587:0:(module.c:412:exit_libcfs_module()) Portals memory leaked: 131600 bytes
Memory leaks detected
Issue here is resolved and landed for 2.10.0. The code cleanup patch is moved to a separate ticket:
LU-9750.