Skip to contentSkip to conversation

NFSD: add cb opcode to WARN_ONCE on failed callback

PATCH In review Olga Kornievskaia 3 participants 3 messages Dec 19, 2024 – Dec 20, 2024

Subsystems (2)
lore
Share & tools
lore

Olga Kornievskaia

author reviewer
#0 lore raw

PATCH 1/1 NFSD: add cb opcode to WARN_ONCE on failed callback

It helps to know what kind of callback happened that triggered the WARN_ONCE in nfsd4_cb_done() function in diagnosing what can set an uncommon state where both cb_status and tk_status are set at the same time.

Fixes e8581a912447 ("nfsd: add more info to WARN_ON_ONCE on failed callbacks")
---
 fs/nfsd/nfs4callback.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
fs/nfsd/nfs4callback.c +3 -2
index f24d8654393d..93b3d27ba0f2 100644
@@ -1397,8 +1397,9 @@ static void nfsd4_cb_done(struct rpc_task *task, void *calldata)
 		return;
 
 	if (cb->cb_status) {
-		WARN_ONCE(task->tk_status, "cb_status=%d tk_status=%d",
-			  cb->cb_status, task->tk_status);
+		WARN_ONCE(task->tk_status,
+			  "cb_status=%d tk_status=%d cb_opcode=%d",
+			  cb->cb_status, task->tk_status, cb->cb_ops->opcode);
 		task->tk_status = cb->cb_status;
 	}
 
Signature · 1 line
2.43.5
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Olga Kornievskaia

It helps to know what kind of callback happened that triggered the WARN_ONCE in nfsd4_cb_done() function in diagnosing what can set an uncommon state where both cb_status and tk_status are set at the same time.

Fixes e8581a912447 ("nfsd: add more info to WARN_ON_ONCE on failed callbacks")
---
 fs/nfsd/nfs4callback.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
fs/nfsd/nfs4callback.c +0 -0
index f24d8654393d..93b3d27ba0f2 100644
@@ -1397,8 +1397,9 @@ static void nfsd4_cb_done(struct rpc_task *task, void *calldata)
 		return;

fs/nfsd/nfs4callback.c static void nfsd4_cb_done(struct rpc_task *task, void *calldata) · line 1405

Quoted 10 lines
fs/nfsd/nfs4callback.c +3 -2
 
 	if (cb->cb_status) {
-		WARN_ONCE(task->tk_status, "cb_status=%d tk_status=%d",
-			  cb->cb_status, task->tk_status);
+		WARN_ONCE(task->tk_status,
+			  "cb_status=%d tk_status=%d cb_opcode=%d",
+			  cb->cb_status, task->tk_status, cb->cb_ops->opcode);
 		task->tk_status = cb->cb_status;
 	}
 
#2 lore raw
In reply to Olga Kornievskaia

From: Chuck Lever <[email protected]>

Quoted 6 lines · Olga Kornievskaia

It helps to know what kind of callback happened that triggered the WARN_ONCE in nfsd4_cb_done() function in diagnosing what can set an uncommon state where both cb_status and tk_status are set at the same time.

Applied to nfsd-testing for v6.14, thanks!

[1/1] NFSD: add cb opcode to WARN_ONCE on failed callback

      commit: a3f44affa23bf2aeccb1eb82492d38f3ad2cade3

--
Chuck Lever