diff mbox series

NFSD: add cb opcode to WARN_ONCE on failed callback

Message ID 20241219215748.13006-1-okorniev@redhat.com (mailing list archive)
State Under Review
Headers show
Series NFSD: add cb opcode to WARN_ONCE on failed callback | expand

Commit Message

Olga Kornievskaia Dec. 19, 2024, 9:57 p.m. UTC
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")
Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
---
 fs/nfsd/nfs4callback.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Jeff Layton Dec. 19, 2024, 10:12 p.m. UTC | #1
On Thu, 2024-12-19 at 16:57 -0500, Olga Kornievskaia wrote:
> 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")
> Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
> ---
>  fs/nfsd/nfs4callback.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
> index f24d8654393d..93b3d27ba0f2 100644
> --- a/fs/nfsd/nfs4callback.c
> +++ b/fs/nfsd/nfs4callback.c
> @@ -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;
>  	}
>  

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Chuck Lever Dec. 20, 2024, 2:32 p.m. UTC | #2
From: Chuck Lever <chuck.lever@oracle.com>

On Thu, 19 Dec 2024 16:57:48 -0500, Olga Kornievskaia wrote:
> 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
diff mbox series

Patch

diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index f24d8654393d..93b3d27ba0f2 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -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;
 	}