From c29eb05fcf9b9c3fced07d8c08a0a565b83338e5 Mon Sep 17 00:00:00 2001 From: Etienne AUJAMES Date: Thu, 9 Jun 2022 22:50:06 +0200 Subject: [PATCH] LU-15926 nrs: fix tbf realtime rules tc_nsecs_resid should be reset to 0 when changing a rule otherwise this could lead to mds crashes for realtime policies. nrs_tbf_req_get(): ASSERTION( cli->tc_nsecs_resid < cli->tc_nsecs ) Lustre-change: https://review.whamcloud.com/47585 Lustre-commit: 530861b344e46bef51c80adac4640c4586d8463a Fixes: d11fa2c27959 ("LU-9228 nrs: TBF realtime policies under congestion") Signed-off-by: Etienne AUJAMES Signed-off-by: Xing Huang Change-Id: I280acb42e104088c6b8750a0bb7bf9c50cf96e73 Reviewed-by: Andreas Dilger Reviewed-by: Yingjin Qian Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/52115 Reviewed-by: Qian Yingjin Tested-by: jenkins Tested-by: Maloo --- lustre/ptlrpc/nrs_tbf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lustre/ptlrpc/nrs_tbf.c b/lustre/ptlrpc/nrs_tbf.c index fc0cd19..6bdf48f 100644 --- a/lustre/ptlrpc/nrs_tbf.c +++ b/lustre/ptlrpc/nrs_tbf.c @@ -133,6 +133,7 @@ nrs_tbf_cli_reset_value(struct nrs_tbf_head *head, cli->tc_rpc_rate = rule->tr_rpc_rate; cli->tc_nsecs = rule->tr_nsecs_per_rpc; + cli->tc_nsecs_resid = 0; cli->tc_depth = rule->tr_depth; cli->tc_ntoken = rule->tr_depth; cli->tc_check_time = ktime_to_ns(ktime_get()); -- 1.8.3.1