浏览代码

nfsd: fix nfsd4_cb_recall_done error handling

For any error that is not EBADHANDLE or NFS4ERR_BAD_STATEID,
nfsd4_cb_recall_done first marks the connection down, then
retries until dl_retries hits zero, then marks the connection down
again and sets cb_done.  This changes the code to only retry
for EBADHANDLE or NFS4ERR_BAD_STATEID, and factors setting
cb_done into a single point in the function.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Christoph Hellwig 11 年之前
父节点
当前提交
444b6e910d
共有 1 个文件被更改,包括 7 次插入10 次删除
  1. 7 10
      fs/nfsd/nfs4callback.c

+ 7 - 10
fs/nfsd/nfs4callback.c

@@ -874,24 +874,21 @@ static void nfsd4_cb_recall_done(struct rpc_task *task, void *calldata)
 		return;
 		return;
 	switch (task->tk_status) {
 	switch (task->tk_status) {
 	case 0:
 	case 0:
-		cb->cb_done = true;
-		return;
+		break;
 	case -EBADHANDLE:
 	case -EBADHANDLE:
 	case -NFS4ERR_BAD_STATEID:
 	case -NFS4ERR_BAD_STATEID:
 		/* Race: client probably got cb_recall
 		/* Race: client probably got cb_recall
 		 * before open reply granting delegation */
 		 * 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:
 	default:
 		/* Network partition? */
 		/* Network partition? */
 		nfsd4_mark_cb_down(clp, task->tk_status);
 		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;
 	cb->cb_done = true;
 }
 }