public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: linux-nfs@vger.kernel.org
Subject: [PATCH, RFC] nfsd: fix nfsd4_cb_recall_done error handling
Date: Mon, 22 Sep 2014 11:29:23 -0700	[thread overview]
Message-ID: <20140922182923.GA18904@infradead.org> (raw)

The error handling for CB_RECALL seems fairly broken to me.

What looks good:

 - for EBADHANDLE and NFS4ERR_BAD_STATEID retry until dl_retries
   hits zero, then mark the connection down and set cb_done

What looks wrong:

 - for everything else we first mark the connection down, then
   retry until dl_retries hits zero, then mark the connection down
   again  and set cb_done.

>From all I can see what we want is:

 - keep the behavior for EBADHANDLE and NFS4ERR_BAD_STATEID,
   otherwise jump straight to making the connection down
   and setting cb_done

But maybe I'm missing something?


diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 17d5441..ed25c58 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -971,24 +971,21 @@ static void nfsd4_cb_recall_done(struct rpc_task *task, void *calldata)
 		return;
 	switch (task->tk_status) {
 	case 0:
-		cb->cb_done = true;
-		return;
+		break;
 	case -EBADHANDLE:
 	case -NFS4ERR_BAD_STATEID:
 		/* Race: client probably got cb_recall
 		 * before open reply granting delegation */
-		break;
+		if (dp->dl_retries--) {
+			rpc_delay(task, 2*HZ);
+			task->tk_status = 0;
+			rpc_restart_call_prepare(task);
+			return;
+		}
 	default:
 		/* Network partition? */
 		nfsd4_mark_cb_down(clp, task->tk_status);
 	}
-	if (dp->dl_retries--) {
-		rpc_delay(task, 2*HZ);
-		task->tk_status = 0;
-		rpc_restart_call_prepare(task);
-		return;
-	}
-	nfsd4_mark_cb_down(clp, task->tk_status);
 	cb->cb_done = true;
 }
 
-- 
1.9.1


             reply	other threads:[~2014-09-22 18:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-22 18:29 Christoph Hellwig [this message]
2014-09-22 20:03 ` [PATCH, RFC] nfsd: fix nfsd4_cb_recall_done error handling Trond Myklebust
2014-09-22 20:06   ` Christoph Hellwig
2014-09-22 20:25 ` J. Bruce Fields

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=20140922182923.GA18904@infradead.org \
    --to=hch@infradead.org \
    --cc=linux-nfs@vger.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