From: Jeff Layton <jlayton@kernel.org>
To: trondmy@kernel.org, Omar Sandoval <osandov@osandov.com>
Cc: Chris Mason <clm@meta.com>, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/2] NFSv4: Handle fatal ENETDOWN and ENETUNREACH errors
Date: Sun, 06 Apr 2025 09:08:09 -0400 [thread overview]
Message-ID: <b0342047d444e49aef379193497dbbc4f3fff3d7.camel@kernel.org> (raw)
In-Reply-To: <756e03b4405f80344f98a695f49e50dd3a1caca0.1743930506.git.trond.myklebust@hammerspace.com>
On Sun, 2025-04-06 at 11:11 +0200, trondmy@kernel.org wrote:
> From: Trond Myklebust <trond.myklebust@hammerspace.com>
>
> Ensure that the NFSv4 error handling code recognises the
> RPC_TASK_NETUNREACH_FATAL flag, and handles the ENETDOWN and ENETUNREACH
> errors accordingly.
>
> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
> ---
> fs/nfs/nfs4proc.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index da97f87ecaa9..f862c862b3a3 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -671,6 +671,15 @@ nfs4_async_handle_exception(struct rpc_task *task, struct nfs_server *server,
> struct nfs_client *clp = server->nfs_client;
> int ret;
>
> + if ((task->tk_rpc_status == -ENETDOWN ||
> + task->tk_rpc_status == -ENETUNREACH) &&
> + task->tk_flags & RPC_TASK_NETUNREACH_FATAL) {
> + exception->retry = 0;
> + exception->recovering = 0;
> + exception->retry = 0;
Why set exception->retry twice?
> + return -EIO;
> + }
> +
> ret = nfs4_do_handle_exception(server, errorcode, exception);
> if (exception->delay) {
> int ret2 = nfs4_exception_should_retrans(server, exception);
Other than that, this looks sane.
Reviewed-by: Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2025-04-06 13:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-06 9:11 [PATCH 0/2] Two more places that need to handle ENETDOWN/ENETUNREACH trondmy
2025-04-06 9:11 ` [PATCH 1/2] NFSv4: Handle fatal ENETDOWN and ENETUNREACH errors trondmy
2025-04-06 13:08 ` Jeff Layton [this message]
2025-04-06 15:28 ` Trond Myklebust
2025-04-06 9:11 ` [PATCH 2/2] NFSv4/pnfs: Layoutreturn on close must handle fatal networking errors trondmy
2025-04-06 13:16 ` Jeff Layton
2025-04-06 15:29 ` Trond Myklebust
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b0342047d444e49aef379193497dbbc4f3fff3d7.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=clm@meta.com \
--cc=linux-nfs@vger.kernel.org \
--cc=osandov@osandov.com \
--cc=trondmy@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox