Linux-NFS Archive on
 help / color / Atom feed
From: "J. Bruce Fields" <>
To: Scott Mayhew <>
Subject: Re: [PATCH] nfsd: update callback done processing
Date: Fri, 3 May 2019 11:10:21 -0400
Message-ID: <> (raw)
In-Reply-To: <>

Thanks, looks good!  Added one more paragraph with what you'd originally
seen (see below), and applied for 5.2.

I haven't added a stable cc, since I didn't think you'd established that
this in itself was causing a major problem--tell me if I'm wrong.


commit 1c73b9d24f80
Author: Scott Mayhew <>
Date:   Thu May 2 13:32:12 2019 -0400

    nfsd: update callback done processing
    Instead of having the convention where individual nfsd4_callback_ops->done
    operations return -1 to indicate the callback path is down, move the check
    to nfsd4_cb_done.  Only mark the callback path down on transport-level
    errors, not NFS-level errors.
    The existing logic causes the server to set SEQ4_STATUS_CB_PATH_DOWN
    just because the client returned an error to a CB_RECALL for a
    delegation that the client had already done a FREE_STATEID for.  But
    clearly that error doesn't mean that there's anything wrong with the
    Additionally, handle NFS4ERR_DELAY in nfsd4_cb_recall_done.  The client
    returns NFS4ERR_DELAY if it is already in the process of returning the
    Signed-off-by: Scott Mayhew <>
    Signed-off-by: J. Bruce Fields <>

diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 7caa3801ce72..b9cbd7189d74 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -1122,10 +1122,11 @@ static void nfsd4_cb_done(struct rpc_task *task, void *calldata)
 	case 1:
-		break;
-	case -1:
-		/* Network partition? */
-		nfsd4_mark_cb_down(clp, task->tk_status);
+		switch (task->tk_status) {
+		case -EIO:
+		case -ETIMEDOUT:
+			nfsd4_mark_cb_down(clp, task->tk_status);
+		}
diff --git a/fs/nfsd/nfs4layouts.c b/fs/nfsd/nfs4layouts.c
index 44517fb5c0de..a79e24b79095 100644
--- a/fs/nfsd/nfs4layouts.c
+++ b/fs/nfsd/nfs4layouts.c
@@ -693,7 +693,7 @@ nfsd4_cb_layout_done(struct nfsd4_callback *cb, struct rpc_task *task)
-		return -1;
+		return 1;
 		task->tk_status = 0;
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 8078314981f5..dfe4b596c2e5 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3970,6 +3970,9 @@ static int nfsd4_cb_recall_done(struct nfsd4_callback *cb,
 	switch (task->tk_status) {
 	case 0:
 		return 1;
+	case -NFS4ERR_DELAY:
+		rpc_delay(task, 2 * HZ);
+		return 0;
@@ -3982,7 +3985,7 @@ static int nfsd4_cb_recall_done(struct nfsd4_callback *cb,
-		return -1;
+		return 1;

      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-02 17:32 Scott Mayhew
2019-05-03 15:10 ` J. Bruce Fields [this message]

Reply instructions:

You may reply publically 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-NFS Archive on

Archives are clonable:
	git clone --mirror linux-nfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nfs linux-nfs/ \
	public-inbox-index linux-nfs

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox