pNFS/flexfiles: Add tracing for layout errors
Trace layout errors for pNFS/flexfiles on read/write/commit operations. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:

committed by
Anna Schumaker

parent
7bdd297ea6
commit
088f3e68d8
@@ -1266,9 +1266,10 @@ static int ff_layout_async_handle_error(struct rpc_task *task,
|
||||
|
||||
static void ff_layout_io_track_ds_error(struct pnfs_layout_segment *lseg,
|
||||
int idx, u64 offset, u64 length,
|
||||
u32 status, int opnum, int error)
|
||||
u32 *op_status, int opnum, int error)
|
||||
{
|
||||
struct nfs4_ff_layout_mirror *mirror;
|
||||
u32 status = *op_status;
|
||||
int err;
|
||||
|
||||
if (status == 0) {
|
||||
@@ -1286,10 +1287,10 @@ static void ff_layout_io_track_ds_error(struct pnfs_layout_segment *lseg,
|
||||
case -ENOBUFS:
|
||||
case -EPIPE:
|
||||
case -EPERM:
|
||||
status = NFS4ERR_NXIO;
|
||||
*op_status = status = NFS4ERR_NXIO;
|
||||
break;
|
||||
case -EACCES:
|
||||
status = NFS4ERR_ACCESS;
|
||||
*op_status = status = NFS4ERR_ACCESS;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
@@ -1321,11 +1322,14 @@ static int ff_layout_read_done_cb(struct rpc_task *task,
|
||||
int new_idx = hdr->pgio_mirror_idx;
|
||||
int err;
|
||||
|
||||
if (task->tk_status < 0)
|
||||
if (task->tk_status < 0) {
|
||||
ff_layout_io_track_ds_error(hdr->lseg, hdr->pgio_mirror_idx,
|
||||
hdr->args.offset, hdr->args.count,
|
||||
hdr->res.op_status, OP_READ,
|
||||
&hdr->res.op_status, OP_READ,
|
||||
task->tk_status);
|
||||
trace_ff_layout_read_error(hdr);
|
||||
}
|
||||
|
||||
err = ff_layout_async_handle_error(task, hdr->args.context->state,
|
||||
hdr->ds_clp, hdr->lseg,
|
||||
hdr->pgio_mirror_idx);
|
||||
@@ -1494,11 +1498,14 @@ static int ff_layout_write_done_cb(struct rpc_task *task,
|
||||
loff_t end_offs = 0;
|
||||
int err;
|
||||
|
||||
if (task->tk_status < 0)
|
||||
if (task->tk_status < 0) {
|
||||
ff_layout_io_track_ds_error(hdr->lseg, hdr->pgio_mirror_idx,
|
||||
hdr->args.offset, hdr->args.count,
|
||||
hdr->res.op_status, OP_WRITE,
|
||||
&hdr->res.op_status, OP_WRITE,
|
||||
task->tk_status);
|
||||
trace_ff_layout_write_error(hdr);
|
||||
}
|
||||
|
||||
err = ff_layout_async_handle_error(task, hdr->args.context->state,
|
||||
hdr->ds_clp, hdr->lseg,
|
||||
hdr->pgio_mirror_idx);
|
||||
@@ -1537,11 +1544,14 @@ static int ff_layout_commit_done_cb(struct rpc_task *task,
|
||||
{
|
||||
int err;
|
||||
|
||||
if (task->tk_status < 0)
|
||||
if (task->tk_status < 0) {
|
||||
ff_layout_io_track_ds_error(data->lseg, data->ds_commit_index,
|
||||
data->args.offset, data->args.count,
|
||||
data->res.op_status, OP_COMMIT,
|
||||
&data->res.op_status, OP_COMMIT,
|
||||
task->tk_status);
|
||||
trace_ff_layout_commit_error(data);
|
||||
}
|
||||
|
||||
err = ff_layout_async_handle_error(task, NULL, data->ds_clp,
|
||||
data->lseg, data->ds_commit_index);
|
||||
|
||||
|
Reference in New Issue
Block a user