2020-12-10 11:52:06

by Mkrtchyan, Tigran

[permalink] [raw]
Subject: [PATCH] nfs41: update ff_layout_io_track_ds_error to accept rpc task

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 <[email protected]>
---
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


2020-12-10 15:05:02

by Trond Myklebust

[permalink] [raw]
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.

--
Trond Myklebust
Linux NFS client maintainer, Hammerspace
[email protected]


2020-12-10 15:14:52

by Mkrtchyan, Tigran

[permalink] [raw]
Subject: Re: [PATCH] nfs41: update ff_layout_io_track_ds_error to accept rpc task



----- Original Message -----
> From: "trondmy" <[email protected]>
> To: "Tigran Mkrtchyan" <[email protected]>, "linux-nfs" <[email protected]>
> Cc: "Anna Schumaker" <[email protected]>
> 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
> [email protected]