Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFSv4: Add tracing for COMPOUND errors

When the server returns a different operation than we expected, then
trace that.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>

+36 -3
+35
fs/nfs/nfs4trace.h
··· 666 666 ) 667 667 ) 668 668 669 + TRACE_EVENT(nfs4_xdr_bad_operation, 670 + TP_PROTO( 671 + const struct xdr_stream *xdr, 672 + u32 op, 673 + u32 expected 674 + ), 675 + 676 + TP_ARGS(xdr, op, expected), 677 + 678 + TP_STRUCT__entry( 679 + __field(unsigned int, task_id) 680 + __field(unsigned int, client_id) 681 + __field(u32, xid) 682 + __field(u32, op) 683 + __field(u32, expected) 684 + ), 685 + 686 + TP_fast_assign( 687 + const struct rpc_rqst *rqstp = xdr->rqst; 688 + const struct rpc_task *task = rqstp->rq_task; 689 + 690 + __entry->task_id = task->tk_pid; 691 + __entry->client_id = task->tk_client->cl_clid; 692 + __entry->xid = be32_to_cpu(rqstp->rq_xid); 693 + __entry->op = op; 694 + __entry->expected = expected; 695 + ), 696 + 697 + TP_printk( 698 + "task:%u@%d xid=0x%08x operation=%u, expected=%u", 699 + __entry->task_id, __entry->client_id, __entry->xid, 700 + __entry->op, __entry->expected 701 + ) 702 + ); 703 + 669 704 TRACE_EVENT(nfs4_xdr_status, 670 705 TP_PROTO( 671 706 const struct xdr_stream *xdr,
+1 -3
fs/nfs/nfs4xdr.c
··· 3210 3210 *nfs_retval = nfs4_stat_to_errno(nfserr); 3211 3211 return true; 3212 3212 out_bad_operation: 3213 - dprintk("nfs: Server returned operation" 3214 - " %d but we issued a request for %d\n", 3215 - opnum, expected); 3213 + trace_nfs4_xdr_bad_operation(xdr, opnum, expected); 3216 3214 *nfs_retval = -EREMOTEIO; 3217 3215 return false; 3218 3216 out_overflow: