Whamcloud - gitweb
LU-14724 nrs: TBF rule list broken when change rule rank
authorQian Yingjin <qian@ddn.com>
Fri, 28 May 2021 03:56:12 +0000 (11:56 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 14 Jan 2022 06:07:21 +0000 (06:07 +0000)
commit345f0d8e56c464a7b4e222430b0f4728c1d13ec7
tree2e21d1e57d9e47ad72432c16fc11f39a829235ad
parentc172c2e3bcb5c4c47de01149069aa46e8aeb30e0
LU-14724 nrs: TBF rule list broken when change rule rank

When change rank of two adjacent rules in the TBF rule list in
@nrs_tbf_rule_change_rank():
list_move(&rule->tr_linkage, next_rule->tr_linkage.prev);

The previous pointer of @next_rule is @rule, using list_move
directly will break the rule list.
In this patch, it use list_del + list_add to repace list_move to
avoid TBF rule broken.
And also add a test case sanityn test_77o for this bug.

Lustre-change: https://review.whamcloud.com/43925
Lustre-commit: e688f29275deeadc0ef4faa01f166986bade301f

Fixes: aa14b0b9a152 ("LU-8006 ptlrpc: specify ordering of TBF policy rules")
Change-Id: Ica30d3329f07914657ac2c4089d66f934021b763
Signed-off-by: Qian Yingjin <qian@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/46017
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/ptlrpc/nrs_tbf.c
lustre/tests/sanityn.sh