nfsd4: treat more recall errors as failures
authorJ. Bruce Fields <bfields@citi.umich.edu>
Sun, 30 May 2010 15:53:12 +0000 (11:53 -0400)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Mon, 31 May 2010 16:43:53 +0000 (12:43 -0400)
If a recall fails for some unexpected reason, instead of ignoring it and
treating it like a success, it's safer to treat it as a failure,
preventing further delgation grants and returning CB_PATH_DOWN.

Also put put switches in a (two me) more logical order, with normal case
first.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
fs/nfsd/nfs4callback.c

index 8a21db22bba4b869c6e3e6d62ea988ef0db92815..ae917921ed415953334d23771e46d1b4f0b2b77d 100644 (file)
@@ -667,7 +667,14 @@ static void nfsd4_cb_recall_done(struct rpc_task *task, void *calldata)
        }
 
        switch (task->tk_status) {
-       case -EIO:
+       case 0:
+               return;
+       case -EBADHANDLE:
+       case -NFS4ERR_BAD_STATEID:
+               /* Race: client probably got cb_recall
+                * before open reply granting delegation */
+               break;
+       default:
                /* Network partition? */
                atomic_set(&clp->cl_cb_set, 0);
                warn_no_callback_path(clp, task->tk_status);
@@ -676,14 +683,6 @@ static void nfsd4_cb_recall_done(struct rpc_task *task, void *calldata)
                        nfsd4_cb_recall(dp);
                        return;
                }
-       case -EBADHANDLE:
-       case -NFS4ERR_BAD_STATEID:
-               /* Race: client probably got cb_recall
-                * before open reply granting delegation */
-               break;
-       default:
-               /* success, or error we can't handle */
-               return;
        }
        if (dp->dl_retries--) {
                rpc_delay(task, 2*HZ);