Linux NFS development
 help / color / mirror / Atom feed
From: "Mkrtchyan, Tigran" <tigran.mkrtchyan@desy.de>
To: linux-nfs <linux-nfs@vger.kernel.org>
Cc: Trond Myklebust <trondmy@kernel.org>, Anna Schumaker <anna@kernel.org>
Subject: Re: [PATCH 1/1] pNFS/flexfiles: mark device unavailable on fatal connection error
Date: Wed, 25 Jun 2025 21:19:31 +0200 (CEST)	[thread overview]
Message-ID: <1758012324.14467514.1750879171477.JavaMail.zimbra@desy.de> (raw)
In-Reply-To: <20250609214303.816241-2-tigran.mkrtchyan@desy.de>

[-- Attachment #1: Type: text/plain, Size: 2188 bytes --]


Hi Folks,

Do you have any opinion on this one? Would you like me to address it differently?

Tigran. 

----- Original Message -----
> From: "Tigran Mkrtchyan" <tigran.mkrtchyan@desy.de>
> To: "linux-nfs" <linux-nfs@vger.kernel.org>
> Cc: "Trond Myklebust" <trondmy@kernel.org>, "Anna Schumaker" <anna@kernel.org>, "Tigran Mkrtchyan"
> <tigran.mkrtchyan@desy.de>
> Sent: Monday, 9 June, 2025 23:43:03
> Subject: [PATCH 1/1] pNFS/flexfiles: mark device unavailable on fatal connection error

> Fixes: 260f32adb88 ("pNFS/flexfiles: Check the result of nfs4_pnfs_ds_connect")
> 
> When an applications get killed (SIGTERM/SIGINT) while pNFS client performs a
> connection
> to DS, client ends in an infinite loop of connect-disconnect. This
> source of the issue, it that flexfilelayoutdev#nfs4_ff_layout_prepare_ds gets an
> error
> on nfs4_pnfs_ds_connect with status ERESTARTSYS, which is set by
> rpc_signal_task, but
> the error is treated as transient, thus retried.
> 
> The issue is reproducible with script as (there should be ~1000 files in
> a directory, client should must not have any connections to DSes):
> 
> ```
> echo 3 > /proc/sys/vm/drop_caches
> 
> for i in *
> do
>        head -1 $i &
>        PP=$!
>        sleep 10e-03
>        kill -TERM $PP
> done
> ```
> 
> Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
> ---
> fs/nfs/flexfilelayout/flexfilelayoutdev.c | 4 ++++
> 1 file changed, 4 insertions(+)
> 
> diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c
> b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
> index 4a304cf17c4b..0008a8180c9b 100644
> --- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c
> +++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
> @@ -410,6 +410,10 @@ nfs4_ff_layout_prepare_ds(struct pnfs_layout_segment *lseg,
> 			mirror->mirror_ds->ds_versions[0].wsize = max_payload;
> 		goto out;
> 	}
> +	/* There is a fatal error to connect to DS. Mark it unavailable to avoid
> infinite retry loop. */
> +	if (nfs_error_is_fatal(status))
> +		nfs4_mark_deviceid_unavailable(&mirror->mirror_ds->id_node);
> +
> noconnect:
> 	ff_layout_track_ds_error(FF_LAYOUT_FROM_HDR(lseg->pls_layout),
> 				 mirror, lseg->pls_range.offset,
> --
> 2.49.0

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 2826 bytes --]

  reply	other threads:[~2025-06-25 19:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-09 21:43 [PATCH 0/1] pNFS/flexfiles: mark device unavailable on fatal connection error Tigran Mkrtchyan
2025-06-09 21:43 ` [PATCH 1/1] " Tigran Mkrtchyan
2025-06-25 19:19   ` Mkrtchyan, Tigran [this message]
2025-06-25 19:39     ` Trond Myklebust
2025-06-26  9:17       ` Mkrtchyan, Tigran

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=1758012324.14467514.1750879171477.JavaMail.zimbra@desy.de \
    --to=tigran.mkrtchyan@desy.de \
    --cc=anna@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --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