Commit 4a706fa0 authored by Trond Myklebust's avatar Trond Myklebust

NFSv4: Clean up nfs4_lock_delegation_recall

All error cases are handled by the switch() statement, meaning that the
call to nfs4_handle_exception() is unreachable.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 8b6cc4d6
...@@ -5144,59 +5144,49 @@ nfs4_proc_lock(struct file *filp, int cmd, struct file_lock *request) ...@@ -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) int nfs4_lock_delegation_recall(struct nfs4_state *state, struct file_lock *fl)
{ {
struct nfs_server *server = NFS_SERVER(state->inode); struct nfs_server *server = NFS_SERVER(state->inode);
struct nfs4_exception exception = { };
int err; int err;
err = nfs4_set_lock_state(state, fl); err = nfs4_set_lock_state(state, fl);
if (err != 0) if (err != 0)
goto out; goto out;
do { err = _nfs4_do_setlk(state, F_SETLK, fl, NFS_LOCK_NEW);
err = _nfs4_do_setlk(state, F_SETLK, fl, NFS_LOCK_NEW); switch (err) {
switch (err) { default:
default: printk(KERN_ERR "NFS: %s: unhandled error "
printk(KERN_ERR "NFS: %s: unhandled error " "%d.\n", __func__, err);
"%d.\n", __func__, err); case 0:
case 0: case -ESTALE:
case -ESTALE: goto out;
goto out; case -NFS4ERR_STALE_CLIENTID:
case -NFS4ERR_STALE_CLIENTID: case -NFS4ERR_STALE_STATEID:
case -NFS4ERR_STALE_STATEID: set_bit(NFS_DELEGATED_STATE, &state->flags);
set_bit(NFS_DELEGATED_STATE, &state->flags); case -NFS4ERR_EXPIRED:
case -NFS4ERR_EXPIRED: nfs4_schedule_lease_recovery(server->nfs_client);
nfs4_schedule_lease_recovery(server->nfs_client); return -EAGAIN;
err = -EAGAIN; case -NFS4ERR_BADSESSION:
goto out; case -NFS4ERR_BADSLOT:
case -NFS4ERR_BADSESSION: case -NFS4ERR_BAD_HIGH_SLOT:
case -NFS4ERR_BADSLOT: case -NFS4ERR_CONN_NOT_BOUND_TO_SESSION:
case -NFS4ERR_BAD_HIGH_SLOT: case -NFS4ERR_DEADSESSION:
case -NFS4ERR_CONN_NOT_BOUND_TO_SESSION: set_bit(NFS_DELEGATED_STATE, &state->flags);
case -NFS4ERR_DEADSESSION: nfs4_schedule_session_recovery(server->nfs_client->cl_session, err);
set_bit(NFS_DELEGATED_STATE, &state->flags); return -EAGAIN;
nfs4_schedule_session_recovery(server->nfs_client->cl_session, err); case -NFS4ERR_DELEG_REVOKED:
err = -EAGAIN; case -NFS4ERR_ADMIN_REVOKED:
goto out; case -NFS4ERR_BAD_STATEID:
case -NFS4ERR_DELEG_REVOKED: case -NFS4ERR_OPENMODE:
case -NFS4ERR_ADMIN_REVOKED: nfs4_schedule_stateid_recovery(server, state);
case -NFS4ERR_BAD_STATEID: return 0;
case -NFS4ERR_OPENMODE: case -NFS4ERR_DELAY:
nfs4_schedule_stateid_recovery(server, state); case -NFS4ERR_GRACE:
err = 0; set_bit(NFS_DELEGATED_STATE, &state->flags);
goto out; ssleep(1);
case -NFS4ERR_DELAY: return -EAGAIN;
case -NFS4ERR_GRACE: case -ENOMEM:
set_bit(NFS_DELEGATED_STATE, &state->flags); case -NFS4ERR_DENIED:
ssleep(1); /* kill_proc(fl->fl_pid, SIGLOST, 1); */
err = -EAGAIN; return 0;
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);
out: out:
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment