public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfs41: update ff_layout_io_track_ds_error to accept rpc task
@ 2020-12-10 10:55 Tigran Mkrtchyan
  2020-12-10 14:42 ` Trond Myklebust
  0 siblings, 1 reply; 3+ messages in thread
From: Tigran Mkrtchyan @ 2020-12-10 10:55 UTC (permalink / raw)
  To: linux-nfs; +Cc: anna.schumaker, trond.myklebust, Tigran Mkrtchyan

When debugging READ_PLUS issues sent to DS I noticed that layoutstats
was reporting READ, though READ_PLUS was used.

The ff_layout_io_track_ds_error function takes the 'major' opnum as an
argumentas well as the corresponding resulting error code.

By passing rpc task as an argument, the bogh values can be extracted
insideff_layout_io_track_ds_error and reduce a possibility of calling
with incorrect opnum.

Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
---
 fs/nfs/flexfilelayout/flexfilelayout.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
index a163533446fa..9da11586f685 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.c
+++ b/fs/nfs/flexfilelayout/flexfilelayout.c
@@ -1213,11 +1213,13 @@ static int ff_layout_async_handle_error(struct rpc_task *task,
 
 static void ff_layout_io_track_ds_error(struct pnfs_layout_segment *lseg,
 					u32 idx, u64 offset, u64 length,
-					u32 *op_status, int opnum, int error)
+					u32 *op_status, struct rpc_task *task)
 {
 	struct nfs4_ff_layout_mirror *mirror;
 	u32 status = *op_status;
 	int err;
+	int error = task->tk_status;
+	int opnum = task->tk_msg.rpc_proc->p_statidx;
 
 	if (status == 0) {
 		switch (error) {
@@ -1279,8 +1281,7 @@ static int ff_layout_read_done_cb(struct rpc_task *task,
 	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,
-					    task->tk_status);
+					    &hdr->res.op_status, task);
 		trace_ff_layout_read_error(hdr);
 	}
 
@@ -1446,8 +1447,7 @@ static int ff_layout_write_done_cb(struct rpc_task *task,
 	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,
-					    task->tk_status);
+					    &hdr->res.op_status, task);
 		trace_ff_layout_write_error(hdr);
 	}
 
@@ -1492,8 +1492,7 @@ static int ff_layout_commit_done_cb(struct rpc_task *task,
 	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,
-					    task->tk_status);
+					    &data->res.op_status, task);
 		trace_ff_layout_commit_error(data);
 	}
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-10 14:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-10 10:55 [PATCH] nfs41: update ff_layout_io_track_ds_error to accept rpc task Tigran Mkrtchyan
2020-12-10 14:42 ` Trond Myklebust
2020-12-10 14:54   ` Mkrtchyan, Tigran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox