From: Qian Yingjin Date: Wed, 3 Jan 2018 09:21:10 +0000 (+0800) Subject: LU-10449 nrs: Generic TBF policy can't be shown correctly X-Git-Tag: 2.10.59~100 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=613f9cb553106316422db40e7f88baccf0438893;p=fs%2Flustre-release.git LU-10449 nrs: Generic TBF policy can't be shown correctly After setting TBF NID/OPCode/JobID policy and switch to generic policy, the output of "lctl get_param ost.OSS.ost.nrs_policies" can not display correctly. Change-Id: If8dcb7ae6ade634ec7ec4dfcb5887501cda90cdf Signed-off-by: Qian Yingjin Reviewed-on: https://review.whamcloud.com/30696 Reviewed-by: Emoly Liu Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Nunez Reviewed-by: Oleg Drokin --- diff --git a/lustre/ptlrpc/nrs.c b/lustre/ptlrpc/nrs.c index 43d1a7c..52d3225 100644 --- a/lustre/ptlrpc/nrs.c +++ b/lustre/ptlrpc/nrs.c @@ -292,6 +292,8 @@ static int nrs_policy_start_locked(struct ptlrpc_nrs_policy *policy, char *arg) CERROR("NRS: arg '%s' is too long\n", arg); GOTO(out, rc = -E2BIG); } + } else { + policy->pol_arg[0] = '\0'; } policy->pol_state = NRS_POL_STATE_STARTED; diff --git a/lustre/tests/sanityn.sh b/lustre/tests/sanityn.sh index 4b9fab1..f028fcc 100755 --- a/lustre/tests/sanityn.sh +++ b/lustre/tests/sanityn.sh @@ -3549,6 +3549,26 @@ test_77k() { run_test 77k "check the extended TBF policy with NID/JobID/OPCode expression" test_77l() { + [[ $(lustre_version_code ost1) -ge $(version_code 2.10.56) ]] || + { skip "Need OST version at least 2.10.56"; return 0; } + + do_facet ost1 lctl set_param ost.OSS.ost_io.nrs_policies="tbf\ nid" + do_facet ost1 lctl set_param ost.OSS.ost_io.nrs_policies="tbf" + + local output=$(do_facet ost1 lctl get_param \ + ost.OSS.ost_io.nrs_policies | \ + awk '/name: tbf/ {print;exit}' | \ + awk -F ': ' '{print $2}') + + if [ "$output" != "tbf" ]; then + error "The generic TBF output is '$output', not 'tbf'" + fi + + do_facet ost1 lctl set_param ost.OSS.ost_io.nrs_policies="fifo" +} +run_test 77l "check the output of NRS policies for generic TBF" + +test_77m() { if [ $(lustre_version_code ost1) -lt $(version_code 2.9.54) ]; then skip "Need OST version at least 2.9.54" return 0 @@ -3598,7 +3618,7 @@ test_77l() { return 0 } -run_test 77l "check NRS Delay slows write RPC processing" +run_test 77m "check NRS Delay slows write RPC processing" test_78() { #LU-6673 local server_version=$(lustre_version_code ost1)