Commit 118b6292 authored by Trond Myklebust's avatar Trond Myklebust Committed by Anna Schumaker

NFS: Fix fix of show_nfs_errors

Casting a negative value to an unsigned long is not the same as
converting it to its absolute value.

Fixes: 96650e2e ("NFS: Fix show_nfs_errors macros again")
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 25925b00
...@@ -352,7 +352,7 @@ DECLARE_EVENT_CLASS(nfs4_clientid_event, ...@@ -352,7 +352,7 @@ DECLARE_EVENT_CLASS(nfs4_clientid_event,
), ),
TP_fast_assign( TP_fast_assign(
__entry->error = error; __entry->error = error < 0 ? -error : 0;
__assign_str(dstaddr, clp->cl_hostname); __assign_str(dstaddr, clp->cl_hostname);
), ),
...@@ -432,7 +432,8 @@ TRACE_EVENT(nfs4_sequence_done, ...@@ -432,7 +432,8 @@ TRACE_EVENT(nfs4_sequence_done,
__entry->target_highest_slotid = __entry->target_highest_slotid =
res->sr_target_highest_slotid; res->sr_target_highest_slotid;
__entry->status_flags = res->sr_status_flags; __entry->status_flags = res->sr_status_flags;
__entry->error = res->sr_status; __entry->error = res->sr_status < 0 ?
-res->sr_status : 0;
), ),
TP_printk( TP_printk(
"error=%ld (%s) session=0x%08x slot_nr=%u seq_nr=%u " "error=%ld (%s) session=0x%08x slot_nr=%u seq_nr=%u "
...@@ -640,7 +641,7 @@ TRACE_EVENT(nfs4_state_mgr_failed, ...@@ -640,7 +641,7 @@ TRACE_EVENT(nfs4_state_mgr_failed,
), ),
TP_fast_assign( TP_fast_assign(
__entry->error = status; __entry->error = status < 0 ? -status : 0;
__entry->state = clp->cl_state; __entry->state = clp->cl_state;
__assign_str(hostname, clp->cl_hostname); __assign_str(hostname, clp->cl_hostname);
__assign_str(section, section); __assign_str(section, section);
...@@ -659,7 +660,7 @@ TRACE_EVENT(nfs4_xdr_status, ...@@ -659,7 +660,7 @@ TRACE_EVENT(nfs4_xdr_status,
TP_PROTO( TP_PROTO(
const struct xdr_stream *xdr, const struct xdr_stream *xdr,
u32 op, u32 op,
int error u32 error
), ),
TP_ARGS(xdr, op, error), TP_ARGS(xdr, op, error),
...@@ -884,7 +885,7 @@ TRACE_EVENT(nfs4_close, ...@@ -884,7 +885,7 @@ TRACE_EVENT(nfs4_close,
__entry->fileid = NFS_FILEID(inode); __entry->fileid = NFS_FILEID(inode);
__entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
__entry->fmode = (__force unsigned int)state->state; __entry->fmode = (__force unsigned int)state->state;
__entry->error = error; __entry->error = error < 0 ? -error : 0;
__entry->stateid_seq = __entry->stateid_seq =
be32_to_cpu(args->stateid.seqid); be32_to_cpu(args->stateid.seqid);
__entry->stateid_hash = __entry->stateid_hash =
...@@ -949,7 +950,7 @@ DECLARE_EVENT_CLASS(nfs4_lock_event, ...@@ -949,7 +950,7 @@ DECLARE_EVENT_CLASS(nfs4_lock_event,
TP_fast_assign( TP_fast_assign(
const struct inode *inode = state->inode; const struct inode *inode = state->inode;
__entry->error = error; __entry->error = error < 0 ? -error : 0;
__entry->cmd = cmd; __entry->cmd = cmd;
__entry->type = request->fl_type; __entry->type = request->fl_type;
__entry->start = request->fl_start; __entry->start = request->fl_start;
...@@ -1021,7 +1022,7 @@ TRACE_EVENT(nfs4_set_lock, ...@@ -1021,7 +1022,7 @@ TRACE_EVENT(nfs4_set_lock,
TP_fast_assign( TP_fast_assign(
const struct inode *inode = state->inode; const struct inode *inode = state->inode;
__entry->error = error; __entry->error = error < 0 ? -error : 0;
__entry->cmd = cmd; __entry->cmd = cmd;
__entry->type = request->fl_type; __entry->type = request->fl_type;
__entry->start = request->fl_start; __entry->start = request->fl_start;
...@@ -1199,7 +1200,7 @@ TRACE_EVENT(nfs4_delegreturn_exit, ...@@ -1199,7 +1200,7 @@ TRACE_EVENT(nfs4_delegreturn_exit,
TP_fast_assign( TP_fast_assign(
__entry->dev = res->server->s_dev; __entry->dev = res->server->s_dev;
__entry->fhandle = nfs_fhandle_hash(args->fhandle); __entry->fhandle = nfs_fhandle_hash(args->fhandle);
__entry->error = error; __entry->error = error < 0 ? -error : 0;
__entry->stateid_seq = __entry->stateid_seq =
be32_to_cpu(args->stateid->seqid); be32_to_cpu(args->stateid->seqid);
__entry->stateid_hash = __entry->stateid_hash =
...@@ -1239,7 +1240,7 @@ DECLARE_EVENT_CLASS(nfs4_test_stateid_event, ...@@ -1239,7 +1240,7 @@ DECLARE_EVENT_CLASS(nfs4_test_stateid_event,
TP_fast_assign( TP_fast_assign(
const struct inode *inode = state->inode; const struct inode *inode = state->inode;
__entry->error = error; __entry->error = error < 0 ? -error : 0;
__entry->dev = inode->i_sb->s_dev; __entry->dev = inode->i_sb->s_dev;
__entry->fileid = NFS_FILEID(inode); __entry->fileid = NFS_FILEID(inode);
__entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
...@@ -1341,7 +1342,7 @@ TRACE_EVENT(nfs4_lookupp, ...@@ -1341,7 +1342,7 @@ TRACE_EVENT(nfs4_lookupp,
TP_fast_assign( TP_fast_assign(
__entry->dev = inode->i_sb->s_dev; __entry->dev = inode->i_sb->s_dev;
__entry->ino = NFS_FILEID(inode); __entry->ino = NFS_FILEID(inode);
__entry->error = error; __entry->error = error < 0 ? -error : 0;
), ),
TP_printk( TP_printk(
...@@ -1377,7 +1378,7 @@ TRACE_EVENT(nfs4_rename, ...@@ -1377,7 +1378,7 @@ TRACE_EVENT(nfs4_rename,
__entry->dev = olddir->i_sb->s_dev; __entry->dev = olddir->i_sb->s_dev;
__entry->olddir = NFS_FILEID(olddir); __entry->olddir = NFS_FILEID(olddir);
__entry->newdir = NFS_FILEID(newdir); __entry->newdir = NFS_FILEID(newdir);
__entry->error = error; __entry->error = error < 0 ? -error : 0;
__assign_str(oldname, oldname->name); __assign_str(oldname, oldname->name);
__assign_str(newname, newname->name); __assign_str(newname, newname->name);
), ),
...@@ -1468,7 +1469,7 @@ DECLARE_EVENT_CLASS(nfs4_inode_stateid_event, ...@@ -1468,7 +1469,7 @@ DECLARE_EVENT_CLASS(nfs4_inode_stateid_event,
__entry->dev = inode->i_sb->s_dev; __entry->dev = inode->i_sb->s_dev;
__entry->fileid = NFS_FILEID(inode); __entry->fileid = NFS_FILEID(inode);
__entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
__entry->error = error; __entry->error = error < 0 ? -error : 0;
__entry->stateid_seq = __entry->stateid_seq =
be32_to_cpu(stateid->seqid); be32_to_cpu(stateid->seqid);
__entry->stateid_hash = __entry->stateid_hash =
...@@ -1524,7 +1525,7 @@ DECLARE_EVENT_CLASS(nfs4_getattr_event, ...@@ -1524,7 +1525,7 @@ DECLARE_EVENT_CLASS(nfs4_getattr_event,
__entry->valid = fattr->valid; __entry->valid = fattr->valid;
__entry->fhandle = nfs_fhandle_hash(fhandle); __entry->fhandle = nfs_fhandle_hash(fhandle);
__entry->fileid = (fattr->valid & NFS_ATTR_FATTR_FILEID) ? fattr->fileid : 0; __entry->fileid = (fattr->valid & NFS_ATTR_FATTR_FILEID) ? fattr->fileid : 0;
__entry->error = error; __entry->error = error < 0 ? -error : 0;
), ),
TP_printk( TP_printk(
...@@ -1571,7 +1572,7 @@ DECLARE_EVENT_CLASS(nfs4_inode_callback_event, ...@@ -1571,7 +1572,7 @@ DECLARE_EVENT_CLASS(nfs4_inode_callback_event,
), ),
TP_fast_assign( TP_fast_assign(
__entry->error = error; __entry->error = error < 0 ? -error : 0;
__entry->fhandle = nfs_fhandle_hash(fhandle); __entry->fhandle = nfs_fhandle_hash(fhandle);
if (!IS_ERR_OR_NULL(inode)) { if (!IS_ERR_OR_NULL(inode)) {
__entry->fileid = NFS_FILEID(inode); __entry->fileid = NFS_FILEID(inode);
...@@ -1628,7 +1629,7 @@ DECLARE_EVENT_CLASS(nfs4_inode_stateid_callback_event, ...@@ -1628,7 +1629,7 @@ DECLARE_EVENT_CLASS(nfs4_inode_stateid_callback_event,
), ),
TP_fast_assign( TP_fast_assign(
__entry->error = error; __entry->error = error < 0 ? -error : 0;
__entry->fhandle = nfs_fhandle_hash(fhandle); __entry->fhandle = nfs_fhandle_hash(fhandle);
if (!IS_ERR_OR_NULL(inode)) { if (!IS_ERR_OR_NULL(inode)) {
__entry->fileid = NFS_FILEID(inode); __entry->fileid = NFS_FILEID(inode);
...@@ -1947,7 +1948,7 @@ TRACE_EVENT(nfs4_layoutget, ...@@ -1947,7 +1948,7 @@ TRACE_EVENT(nfs4_layoutget,
__entry->iomode = args->iomode; __entry->iomode = args->iomode;
__entry->offset = args->offset; __entry->offset = args->offset;
__entry->count = args->length; __entry->count = args->length;
__entry->error = error; __entry->error = error < 0 ? -error : 0;
__entry->stateid_seq = __entry->stateid_seq =
be32_to_cpu(state->stateid.seqid); be32_to_cpu(state->stateid.seqid);
__entry->stateid_hash = __entry->stateid_hash =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment