Whamcloud - gitweb
LU-10449 nrs: Generic TBF policy can't be shown correctly 96/30696/6
authorQian Yingjin <qian@ddn.com>
Wed, 3 Jan 2018 09:21:10 +0000 (17:21 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 22 Feb 2018 05:40:17 +0000 (05:40 +0000)
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 <qian@ddn.com>
Reviewed-on: https://review.whamcloud.com/30696
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ptlrpc/nrs.c
lustre/tests/sanityn.sh

index 43d1a7c..52d3225 100644 (file)
@@ -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;
index 4b9fab1..f028fcc 100755 (executable)
@@ -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)