Whamcloud - gitweb
LU-17015 sec: fix PTLRPC_CTX_STATUS_MASK
authorSebastien Buisson <sbuisson@ddn.com>
Wed, 11 Oct 2023 13:29:46 +0000 (15:29 +0200)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 14 Dec 2023 13:56:29 +0000 (13:56 +0000)
commitf4cb1c444dbc7ff963f6af29d445fdd4caf2dc82
treed4463d96dc269b6e904b23d344560e46b8e3b462
parent4f67237b179377066b6fb31741684f15ae884344
LU-17015 sec: fix PTLRPC_CTX_STATUS_MASK

PTLRPC_CTX_STATUS_MASK should not include PTLRPC_CTX_NEW_BIT, which is
a bit index and not a value. Also, according to code in
sptlrpc_req_refresh_ctx():
if (unlikely(test_bit(PTLRPC_CTX_NEW_BIT, &ctx->cc_flags))) {
   if (ctx->cc_ops->refresh)
      ctx->cc_ops->refresh(ctx);
}
a context needs to be refreshed if it has the PTLRPC_CTX_NEW_BIT bit.
So the function to check if context is refreshed, cli_ctx_is_refreshed
should not return true if the PTLRPC_CTX_NEW_BIT bit is set.

In the end, do not replace PTLRPC_CTX_NEW_BIT with anything else in
PTLRPC_CTX_STATUS_MASK. Having PTLRPC_CTX_NEW_BIT was a no-op (bitwise
OR with 0), but this was working as expected. Just cleanup the code to
avoid headaches.

Lustre-change: https://review.whamcloud.com/52629
Lustre-commit: c744221a1fd55df33ca2b0e3e1b1ffd7ef3a986d

Test-Parameters: trivial
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Ibc2ca9dfaa176b098080f7f2867338b62953b50e
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53441
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/include/lustre_sec.h