diff mbox series

nfs41: update ff_layout_io_track_ds_error to accept rpc task

Message ID 20201210105543.22489-1-tigran.mkrtchyan@desy.de (mailing list archive)
State New, archived
Headers show
Series nfs41: update ff_layout_io_track_ds_error to accept rpc task | expand

Commit Message

Mkrtchyan, Tigran Dec. 10, 2020, 10:55 a.m. UTC
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(-)

Comments

Trond Myklebust Dec. 10, 2020, 2:42 p.m. UTC | #1
Hi Tigran,

On Thu, 2020-12-10 at 10:55 +0000, Tigran Mkrtchyan wrote:
> 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.

I think we just want to disable READ_PLUS support in pNFS for the
moment. We have no way of discovering and tracking whether or not the
DS actually supports it, so let's leave it out for now.
Mkrtchyan, Tigran Dec. 10, 2020, 2:54 p.m. UTC | #2
----- Original Message -----
> From: "trondmy" <trondmy@hammerspace.com>
> To: "Tigran Mkrtchyan" <tigran.mkrtchyan@desy.de>, "linux-nfs" <linux-nfs@vger.kernel.org>
> Cc: "Anna Schumaker" <anna.schumaker@netapp.com>
> Sent: Thursday, 10 December, 2020 15:42:38
> Subject: Re: [PATCH] nfs41: update ff_layout_io_track_ds_error to accept rpc task

> Hi Tigran,
> 
> On Thu, 2020-12-10 at 10:55 +0000, Tigran Mkrtchyan wrote:
>> 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.
> 
> I think we just want to disable READ_PLUS support in pNFS for the
> moment. We have no way of discovering and tracking whether or not the
> DS actually supports it, so let's leave it out for now.


No objections.

Tigran.

> 
> --
> Trond Myklebust
> Linux NFS client maintainer, Hammerspace
> trond.myklebust@hammerspace.com
diff mbox series

Patch

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);
 	}