All of lore.kernel.org
 help / color / mirror / Atom feed
From: cel@kernel.org
To: Neil Brown <neilb@suse.de>, Jeff Layton <jlayton@kernel.org>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <dai.ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: <linux-nfs@vger.kernel.org>, Chuck Lever <chuck.lever@oracle.com>
Subject: [RFC PATCH 3/9] NFSD: Handle an NFS4ERR_DELAY response to CB_OFFLOAD
Date: Tue,  8 Oct 2024 09:47:22 -0400	[thread overview]
Message-ID: <20241008134719.116825-14-cel@kernel.org> (raw)
In-Reply-To: <20241008134719.116825-11-cel@kernel.org>

From: Chuck Lever <chuck.lever@oracle.com>

RFC 7862 permits callback services to respond to CB_OFFLOAD with
NFS4ERR_DELAY. Currently NFSD drops the CB_OFFLOAD in that case.

To improve the reliability of COPY offload, NFSD should rather send
another CB_OFFLOAD completion notification.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 fs/nfsd/nfs4proc.c | 8 ++++++++
 fs/nfsd/xdr4.h     | 1 +
 2 files changed, 9 insertions(+)

diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index a3c564a9596c..02e73ebbfe5c 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1613,6 +1613,13 @@ static int nfsd4_cb_offload_done(struct nfsd4_callback *cb,
 		container_of(cb, struct nfsd4_cb_offload, co_cb);
 
 	trace_nfsd_cb_offload_done(&cbo->co_res.cb_stateid, task);
+	switch (task->tk_status) {
+	case -NFS4ERR_DELAY:
+		if (cbo->co_retries--) {
+			rpc_delay(task, 1 * HZ);
+			return 0;
+		}
+	}
 	return 1;
 }
 
@@ -1742,6 +1749,7 @@ static void nfsd4_send_cb_offload(struct nfsd4_copy *copy)
 	memcpy(&cbo->co_res, &copy->cp_res, sizeof(copy->cp_res));
 	memcpy(&cbo->co_fh, &copy->fh, sizeof(copy->fh));
 	cbo->co_nfserr = copy->nfserr;
+	cbo->co_retries = 5;
 
 	nfsd4_init_cb(&cbo->co_cb, copy->cp_clp, &nfsd4_cb_offload_ops,
 		      NFSPROC4_CLNT_CB_OFFLOAD);
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h
index dec29afa43f3..cd2bf63651e3 100644
--- a/fs/nfsd/xdr4.h
+++ b/fs/nfsd/xdr4.h
@@ -675,6 +675,7 @@ struct nfsd4_cb_offload {
 	struct nfsd4_callback	co_cb;
 	struct nfsd42_write_res	co_res;
 	__be32			co_nfserr;
+	unsigned int		co_retries;
 	struct knfsd_fh		co_fh;
 };
 
-- 
2.46.2


  parent reply	other threads:[~2024-10-08 13:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08 13:47 [RFC PATCH 0/9] async COPY fixes cel
2024-10-08 13:47 ` [RFC PATCH 1/9] NFS: CB_OFFLOAD can return NFS4ERR_DELAY cel
2024-10-08 13:47 ` [RFC PATCH 2/9] NFSD: Free async copy information in nfsd4_cb_offload_release() cel
2024-10-09 15:14   ` Chuck Lever
2024-10-08 13:47 ` cel [this message]
2024-10-08 21:54   ` [RFC PATCH 3/9] NFSD: Handle an NFS4ERR_DELAY response to CB_OFFLOAD NeilBrown
2024-10-09 14:10     ` Chuck Lever
2024-10-08 13:47 ` [RFC PATCH 4/9] NFS: Fix typo in OFFLOAD_CANCEL comment cel
2024-10-08 13:47 ` [RFC PATCH 5/9] NFS: Implement NFSv4.2's OFFLOAD_STATUS XDR cel
2024-10-08 22:00   ` NeilBrown
2024-10-08 13:47 ` [RFC PATCH 6/9] NFS: Rename struct nfs4_offloadcancel_data cel
2024-10-08 13:47 ` [RFC PATCH 7/9] NFS: Implement NFSv4.2's OFFLOAD_STATUS operation cel
2024-10-08 22:09   ` NeilBrown
2024-10-09 14:47     ` Chuck Lever
2024-10-08 13:47 ` [RFC PATCH 8/9] NFS: Use " cel
2024-10-08 22:10   ` NeilBrown
2024-10-09 15:45     ` Chuck Lever
2024-10-08 13:47 ` [RFC PATCH 9/9] NFS: Refactor trace_nfs4_offload_cancel cel
2024-10-08 13:51 ` [RFC PATCH 0/9] async COPY fixes Chuck Lever III

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=20241008134719.116825-14-cel@kernel.org \
    --to=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=dai.ngo@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.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.