aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-04-01 14:47:22 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-04-05 17:03:54 -0400
commit4a706fa09fd59b9c73b2a933953d27f3e18619c1 (patch)
treeab7d9ad930025ec468cd4d8019e333ab3faf5304 /fs/nfs
parent8b6cc4d6f841d31f72fe7478453759166d366274 (diff)
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: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/nfs4proc.c86
1 files changed, 38 insertions, 48 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 6630db1336a9..5f2010e0926e 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5144,59 +5144,49 @@ nfs4_proc_lock(struct file *filp, int cmd, struct file_lock *request)
5144int nfs4_lock_delegation_recall(struct nfs4_state *state, struct file_lock *fl) 5144int nfs4_lock_delegation_recall(struct nfs4_state *state, struct file_lock *fl)
5145{ 5145{
5146 struct nfs_server *server = NFS_SERVER(state->inode); 5146 struct nfs_server *server = NFS_SERVER(state->inode);
5147 struct nfs4_exception exception = { };
5148 int err; 5147 int err;
5149 5148
5150 err = nfs4_set_lock_state(state, fl); 5149 err = nfs4_set_lock_state(state, fl);
5151 if (err != 0) 5150 if (err != 0)
5152 goto out; 5151 goto out;
5153 do { 5152 err = _nfs4_do_setlk(state, F_SETLK, fl, NFS_LOCK_NEW);
5154 err = _nfs4_do_setlk(state, F_SETLK, fl, NFS_LOCK_NEW); 5153 switch (err) {
5155 switch (err) { 5154 default:
5156 default: 5155 printk(KERN_ERR "NFS: %s: unhandled error "
5157 printk(KERN_ERR "NFS: %s: unhandled error " 5156 "%d.\n", __func__, err);
5158 "%d.\n", __func__, err); 5157 case 0:
5159 case 0: 5158 case -ESTALE:
5160 case -ESTALE: 5159 goto out;
5161 goto out; 5160 case -NFS4ERR_STALE_CLIENTID:
5162 case -NFS4ERR_STALE_CLIENTID: 5161 case -NFS4ERR_STALE_STATEID:
5163 case -NFS4ERR_STALE_STATEID: 5162 set_bit(NFS_DELEGATED_STATE, &state->flags);
5164 set_bit(NFS_DELEGATED_STATE, &state->flags); 5163 case -NFS4ERR_EXPIRED:
5165 case -NFS4ERR_EXPIRED: 5164 nfs4_schedule_lease_recovery(server->nfs_client);
5166 nfs4_schedule_lease_recovery(server->nfs_client); 5165 return -EAGAIN;
5167 err = -EAGAIN; 5166 case -NFS4ERR_BADSESSION:
5168 goto out; 5167 case -NFS4ERR_BADSLOT:
5169 case -NFS4ERR_BADSESSION: 5168 case -NFS4ERR_BAD_HIGH_SLOT:
5170 case -NFS4ERR_BADSLOT: 5169 case -NFS4ERR_CONN_NOT_BOUND_TO_SESSION:
5171 case -NFS4ERR_BAD_HIGH_SLOT: 5170 case -NFS4ERR_DEADSESSION:
5172 case -NFS4ERR_CONN_NOT_BOUND_TO_SESSION: 5171 set_bit(NFS_DELEGATED_STATE, &state->flags);
5173 case -NFS4ERR_DEADSESSION: 5172 nfs4_schedule_session_recovery(server->nfs_client->cl_session, err);
5174 set_bit(NFS_DELEGATED_STATE, &state->flags); 5173 return -EAGAIN;
5175 nfs4_schedule_session_recovery(server->nfs_client->cl_session, err); 5174 case -NFS4ERR_DELEG_REVOKED:
5176 err = -EAGAIN; 5175 case -NFS4ERR_ADMIN_REVOKED:
5177 goto out; 5176 case -NFS4ERR_BAD_STATEID:
5178 case -NFS4ERR_DELEG_REVOKED: 5177 case -NFS4ERR_OPENMODE:
5179 case -NFS4ERR_ADMIN_REVOKED: 5178 nfs4_schedule_stateid_recovery(server, state);
5180 case -NFS4ERR_BAD_STATEID: 5179 return 0;
5181 case -NFS4ERR_OPENMODE: 5180 case -NFS4ERR_DELAY:
5182 nfs4_schedule_stateid_recovery(server, state); 5181 case -NFS4ERR_GRACE:
5183 err = 0; 5182 set_bit(NFS_DELEGATED_STATE, &state->flags);
5184 goto out; 5183 ssleep(1);
5185 case -NFS4ERR_DELAY: 5184 return -EAGAIN;
5186 case -NFS4ERR_GRACE: 5185 case -ENOMEM:
5187 set_bit(NFS_DELEGATED_STATE, &state->flags); 5186 case -NFS4ERR_DENIED:
5188 ssleep(1); 5187 /* kill_proc(fl->fl_pid, SIGLOST, 1); */
5189 err = -EAGAIN; 5188 return 0;
5190 goto out; 5189 }
5191 case -ENOMEM:
5192 case -NFS4ERR_DENIED:
5193 /* kill_proc(fl->fl_pid, SIGLOST, 1); */
5194 err = 0;
5195 goto out;
5196 }
5197 set_bit(NFS_DELEGATED_STATE, &state->flags);
5198 err = nfs4_handle_exception(server, err, &exception);
5199 } while (exception.retry);
5200out: 5190out:
5201 return err; 5191 return err;
5202} 5192}