All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olga Kornievskaia <olga.kornievskaia@gmail.com>
To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 1/1] NFSv4.1/pnfs: error gracefully on partial pnfs layout
Date: Wed,  7 Feb 2024 13:29:12 -0500	[thread overview]
Message-ID: <20240207182912.30981-1-olga.kornievskaia@gmail.com> (raw)

From: Olga Kornievskaia <kolga@netapp.com>

Currently, if the server returns a partial layout, the client gets
stuck asking for a layout indefinitely. Until we add support for
partial layouts, treat partial layout as layout unavailable error.

Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
---
 fs/nfs/nfs4proc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index dae4c1b6cc1c..108bc7f3e8c2 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -9790,6 +9790,12 @@ nfs4_proc_layoutget(struct nfs4_layoutget *lgp,
 	if (status != 0)
 		goto out;
 
+	/* Since client does not support partial pnfs layout, then treat
+	 * getting a partial layout as LAYOUTUNAVAILABLE error
+	 */
+	if (lgp->args.range.length != lgp->res.range.length)
+		task->tk_status = -NFS4ERR_LAYOUTUNAVAILABLE;
+
 	if (task->tk_status < 0) {
 		exception->retry = 1;
 		status = nfs4_layoutget_handle_exception(task, lgp, exception);
-- 
2.39.1


             reply	other threads:[~2024-02-07 18:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-07 18:29 Olga Kornievskaia [this message]
2024-02-07 19:12 ` [PATCH 1/1] NFSv4.1/pnfs: error gracefully on partial pnfs layout Trond Myklebust
2024-02-07 19:51   ` Olga Kornievskaia
2024-02-07 19:58     ` Olga Kornievskaia
2024-02-07 20:22       ` Trond Myklebust
2024-02-07 20:42       ` Trond Myklebust
2024-02-07 21:44         ` Olga Kornievskaia

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=20240207182912.30981-1-olga.kornievskaia@gmail.com \
    --to=olga.kornievskaia@gmail.com \
    --cc=anna.schumaker@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@hammerspace.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.