Skip to content

Commit

Permalink
NFS: Add tracepoints for layouterror and layoutstats.
Browse files Browse the repository at this point in the history
Allow tracing of the NFSv4.2 layouterror and layoutstats operations.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
  • Loading branch information
Trond Myklebust committed Aug 5, 2020
1 parent a19b478 commit 638037b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions fs/nfs/nfs42proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "nfs4session.h"
#include "internal.h"
#include "delegation.h"
#include "nfs4trace.h"

#define NFSDBG_FACILITY NFSDBG_PROC
static int nfs42_do_offload_cancel_async(struct file *dst, nfs4_stateid *std);
Expand Down Expand Up @@ -714,7 +715,7 @@ nfs42_layoutstat_done(struct rpc_task *task, void *calldata)

switch (task->tk_status) {
case 0:
break;
return;
case -NFS4ERR_BADHANDLE:
case -ESTALE:
pnfs_destroy_layout(NFS_I(inode));
Expand Down Expand Up @@ -760,6 +761,8 @@ nfs42_layoutstat_done(struct rpc_task *task, void *calldata)
case -EOPNOTSUPP:
NFS_SERVER(inode)->caps &= ~NFS_CAP_LAYOUTSTATS;
}

trace_nfs4_layoutstats(inode, &data->args.stateid, task->tk_status);
}

static void
Expand Down Expand Up @@ -882,7 +885,7 @@ nfs42_layouterror_done(struct rpc_task *task, void *calldata)

switch (task->tk_status) {
case 0:
break;
return;
case -NFS4ERR_BADHANDLE:
case -ESTALE:
pnfs_destroy_layout(NFS_I(inode));
Expand Down Expand Up @@ -926,6 +929,9 @@ nfs42_layouterror_done(struct rpc_task *task, void *calldata)
case -EOPNOTSUPP:
NFS_SERVER(inode)->caps &= ~NFS_CAP_LAYOUTERROR;
}

trace_nfs4_layouterror(inode, &data->args.errors[0].stateid,
task->tk_status);
}

static void
Expand Down
2 changes: 2 additions & 0 deletions fs/nfs/nfs4trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -1994,6 +1994,8 @@ TRACE_EVENT(nfs4_layoutget,
DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutcommit);
DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutreturn);
DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutreturn_on_close);
DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layouterror);
DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutstats);

TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_UNKNOWN);
TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_NO_PNFS);
Expand Down

0 comments on commit 638037b

Please sign in to comment.