NFSv4: Clean up nfs4_lock_delegation_recall
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 1 Apr 2013 18:47:22 +0000 (14:47 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 5 Apr 2013 21:03:54 +0000 (17:03 -0400)
All error cases are handled by the switch() statement, meaning that the
call to nfs4_handle_exception() is unreachable.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/nfs4proc.c

index 6630db1336a981368da2b58ba93b0776303540f3..5f2010e0926ec839706aa2734b28c88fc18e81fc 100644 (file)
@@ -5144,59 +5144,49 @@ nfs4_proc_lock(struct file *filp, int cmd, struct file_lock *request)
 int nfs4_lock_delegation_recall(struct nfs4_state *state, struct file_lock *fl)
 {
        struct nfs_server *server = NFS_SERVER(state->inode);
-       struct nfs4_exception exception = { };
        int err;
 
        err = nfs4_set_lock_state(state, fl);
        if (err != 0)
                goto out;
-       do {
-               err = _nfs4_do_setlk(state, F_SETLK, fl, NFS_LOCK_NEW);
-               switch (err) {
-                       default:
-                               printk(KERN_ERR "NFS: %s: unhandled error "
-                                       "%d.\n", __func__, err);
-                       case 0:
-                       case -ESTALE:
-                               goto out;
-                       case -NFS4ERR_STALE_CLIENTID:
-                       case -NFS4ERR_STALE_STATEID:
-                               set_bit(NFS_DELEGATED_STATE, &state->flags);
-                       case -NFS4ERR_EXPIRED:
-                               nfs4_schedule_lease_recovery(server->nfs_client);
-                               err = -EAGAIN;
-                               goto out;
-                       case -NFS4ERR_BADSESSION:
-                       case -NFS4ERR_BADSLOT:
-                       case -NFS4ERR_BAD_HIGH_SLOT:
-                       case -NFS4ERR_CONN_NOT_BOUND_TO_SESSION:
-                       case -NFS4ERR_DEADSESSION:
-                               set_bit(NFS_DELEGATED_STATE, &state->flags);
-                               nfs4_schedule_session_recovery(server->nfs_client->cl_session, err);
-                               err = -EAGAIN;
-                               goto out;
-                       case -NFS4ERR_DELEG_REVOKED:
-                       case -NFS4ERR_ADMIN_REVOKED:
-                       case -NFS4ERR_BAD_STATEID:
-                       case -NFS4ERR_OPENMODE:
-                               nfs4_schedule_stateid_recovery(server, state);
-                               err = 0;
-                               goto out;
-                       case -NFS4ERR_DELAY:
-                       case -NFS4ERR_GRACE:
-                               set_bit(NFS_DELEGATED_STATE, &state->flags);
-                               ssleep(1);
-                               err = -EAGAIN;
-                               goto out;
-                       case -ENOMEM:
-                       case -NFS4ERR_DENIED:
-                               /* kill_proc(fl->fl_pid, SIGLOST, 1); */
-                               err = 0;
-                               goto out;
-               }
-               set_bit(NFS_DELEGATED_STATE, &state->flags);
-               err = nfs4_handle_exception(server, err, &exception);
-       } while (exception.retry);
+       err = _nfs4_do_setlk(state, F_SETLK, fl, NFS_LOCK_NEW);
+       switch (err) {
+               default:
+                       printk(KERN_ERR "NFS: %s: unhandled error "
+                               "%d.\n", __func__, err);
+               case 0:
+               case -ESTALE:
+                       goto out;
+               case -NFS4ERR_STALE_CLIENTID:
+               case -NFS4ERR_STALE_STATEID:
+                       set_bit(NFS_DELEGATED_STATE, &state->flags);
+               case -NFS4ERR_EXPIRED:
+                       nfs4_schedule_lease_recovery(server->nfs_client);
+                       return -EAGAIN;
+               case -NFS4ERR_BADSESSION:
+               case -NFS4ERR_BADSLOT:
+               case -NFS4ERR_BAD_HIGH_SLOT:
+               case -NFS4ERR_CONN_NOT_BOUND_TO_SESSION:
+               case -NFS4ERR_DEADSESSION:
+                       set_bit(NFS_DELEGATED_STATE, &state->flags);
+                       nfs4_schedule_session_recovery(server->nfs_client->cl_session, err);
+                       return -EAGAIN;
+               case -NFS4ERR_DELEG_REVOKED:
+               case -NFS4ERR_ADMIN_REVOKED:
+               case -NFS4ERR_BAD_STATEID:
+               case -NFS4ERR_OPENMODE:
+                       nfs4_schedule_stateid_recovery(server, state);
+                       return 0;
+               case -NFS4ERR_DELAY:
+               case -NFS4ERR_GRACE:
+                       set_bit(NFS_DELEGATED_STATE, &state->flags);
+                       ssleep(1);
+                       return -EAGAIN;
+               case -ENOMEM:
+               case -NFS4ERR_DENIED:
+                       /* kill_proc(fl->fl_pid, SIGLOST, 1); */
+                       return 0;
+       }
 out:
        return err;
 }