Whamcloud - gitweb
LU-14724 nrs: TBF rule list broken when change rule rank 25/43925/6
authorQian Yingjin <qian@ddn.com>
Fri, 28 May 2021 03:56:12 +0000 (11:56 +0800)
committerOleg Drokin <green@whamcloud.com>
Fri, 17 Sep 2021 14:06:28 +0000 (14:06 +0000)
commite688f29275deeadc0ef4faa01f166986bade301f
tree922e2c9fb0a8626fa6135383fdb2e2049f0db6ad
parentc0a7f78529e21c9cafa986abea255925b4b41244
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.

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