NFS: Add trace events to report non-zero NFS status codes

These can help field troubleshooting without needing the overhead
of a full network capture (ie, tcpdump).

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
Chuck Lever
2019-02-11 11:24:26 -05:00
committed by Anna Schumaker
parent eb72f484a5
commit f23f658404
6 changed files with 133 additions and 4 deletions

View File

@@ -54,6 +54,7 @@
#include <linux/nfs_fs.h>
#include "nfs4_fs.h"
#include "nfs4trace.h"
#include "internal.h"
#include "nfs4idmap.h"
#include "nfs4session.h"
@@ -3188,11 +3189,14 @@ static bool __decode_op_hdr(struct xdr_stream *xdr, enum nfs_opnum4 expected,
opnum = be32_to_cpup(p++);
if (unlikely(opnum != expected))
goto out_bad_operation;
if (unlikely(*p != cpu_to_be32(NFS_OK)))
goto out_status;
*nfs_retval = 0;
return true;
out_status:
nfserr = be32_to_cpup(p);
if (nfserr == NFS_OK)
*nfs_retval = 0;
else
*nfs_retval = nfs4_stat_to_errno(nfserr);
trace_nfs4_xdr_status(opnum, nfserr);
*nfs_retval = nfs4_stat_to_errno(nfserr);
return true;
out_bad_operation:
dprintk("nfs: Server returned operation"