aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2009-06-17 21:13:00 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2009-06-18 21:13:44 -0400
commit1f84603c0940d5bed17f7e4d2e0b2a4b8b8f1b81 (patch)
tree143956f878290e85de7c9130f465e862f587ee53 /fs/nfs/nfs4proc.c
parent301933a0acfdec837fd8b4884093b3f0fff01d8a (diff)
parent4bf259e3ae5015e73282ba66716c4a917e1264ac (diff)
Merge branch 'devel-for-2.6.31' into for-2.6.31
Conflicts: fs/nfs/client.c fs/nfs/super.c
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c61
1 files changed, 51 insertions, 10 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 57dabb8a048e..7a750f061c26 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1173,16 +1173,30 @@ int nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state
1173 err = _nfs4_open_delegation_recall(ctx, state, stateid); 1173 err = _nfs4_open_delegation_recall(ctx, state, stateid);
1174 switch (err) { 1174 switch (err) {
1175 case 0: 1175 case 0:
1176 return err; 1176 case -ENOENT:
1177 case -ESTALE:
1178 goto out;
1177 case -NFS4ERR_STALE_CLIENTID: 1179 case -NFS4ERR_STALE_CLIENTID:
1178 case -NFS4ERR_STALE_STATEID: 1180 case -NFS4ERR_STALE_STATEID:
1179 case -NFS4ERR_EXPIRED: 1181 case -NFS4ERR_EXPIRED:
1180 /* Don't recall a delegation if it was lost */ 1182 /* Don't recall a delegation if it was lost */
1181 nfs4_schedule_state_recovery(server->nfs_client); 1183 nfs4_schedule_state_recovery(server->nfs_client);
1182 return err; 1184 goto out;
1185 case -ERESTARTSYS:
1186 /*
1187 * The show must go on: exit, but mark the
1188 * stateid as needing recovery.
1189 */
1190 case -NFS4ERR_ADMIN_REVOKED:
1191 case -NFS4ERR_BAD_STATEID:
1192 nfs4_state_mark_reclaim_nograce(server->nfs_client, state);
1193 case -ENOMEM:
1194 err = 0;
1195 goto out;
1183 } 1196 }
1184 err = nfs4_handle_exception(server, err, &exception); 1197 err = nfs4_handle_exception(server, err, &exception);
1185 } while (exception.retry); 1198 } while (exception.retry);
1199out:
1186 return err; 1200 return err;
1187} 1201}
1188 1202
@@ -3238,8 +3252,6 @@ static ssize_t nfs4_proc_get_acl(struct inode *inode, void *buf, size_t buflen)
3238 ret = nfs_revalidate_inode(server, inode); 3252 ret = nfs_revalidate_inode(server, inode);
3239 if (ret < 0) 3253 if (ret < 0)
3240 return ret; 3254 return ret;
3241 if (NFS_I(inode)->cache_validity & NFS_INO_INVALID_ACL)
3242 nfs_zap_acl_cache(inode);
3243 ret = nfs4_read_cached_acl(inode, buf, buflen); 3255 ret = nfs4_read_cached_acl(inode, buf, buflen);
3244 if (ret != -ENOENT) 3256 if (ret != -ENOENT)
3245 return ret; 3257 return ret;
@@ -3977,8 +3989,6 @@ static int _nfs4_do_setlk(struct nfs4_state *state, int cmd, struct file_lock *f
3977 ret = nfs4_wait_for_completion_rpc_task(task); 3989 ret = nfs4_wait_for_completion_rpc_task(task);
3978 if (ret == 0) { 3990 if (ret == 0) {
3979 ret = data->rpc_status; 3991 ret = data->rpc_status;
3980 if (ret == -NFS4ERR_DENIED)
3981 ret = -EAGAIN;
3982 } else 3992 } else
3983 data->cancelled = 1; 3993 data->cancelled = 1;
3984 rpc_put_task(task); 3994 rpc_put_task(task);
@@ -4066,9 +4076,11 @@ static int nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock *
4066 int err; 4076 int err;
4067 4077
4068 do { 4078 do {
4079 err = _nfs4_proc_setlk(state, cmd, request);
4080 if (err == -NFS4ERR_DENIED)
4081 err = -EAGAIN;
4069 err = nfs4_handle_exception(NFS_SERVER(state->inode), 4082 err = nfs4_handle_exception(NFS_SERVER(state->inode),
4070 _nfs4_proc_setlk(state, cmd, request), 4083 err, &exception);
4071 &exception);
4072 } while (exception.retry); 4084 } while (exception.retry);
4073 return err; 4085 return err;
4074} 4086}
@@ -4120,8 +4132,37 @@ int nfs4_lock_delegation_recall(struct nfs4_state *state, struct file_lock *fl)
4120 goto out; 4132 goto out;
4121 do { 4133 do {
4122 err = _nfs4_do_setlk(state, F_SETLK, fl, 0); 4134 err = _nfs4_do_setlk(state, F_SETLK, fl, 0);
4123 if (err != -NFS4ERR_DELAY) 4135 switch (err) {
4124 break; 4136 default:
4137 printk(KERN_ERR "%s: unhandled error %d.\n",
4138 __func__, err);
4139 case 0:
4140 case -ESTALE:
4141 goto out;
4142 case -NFS4ERR_EXPIRED:
4143 case -NFS4ERR_STALE_CLIENTID:
4144 case -NFS4ERR_STALE_STATEID:
4145 nfs4_schedule_state_recovery(server->nfs_client);
4146 goto out;
4147 case -ERESTARTSYS:
4148 /*
4149 * The show must go on: exit, but mark the
4150 * stateid as needing recovery.
4151 */
4152 case -NFS4ERR_ADMIN_REVOKED:
4153 case -NFS4ERR_BAD_STATEID:
4154 case -NFS4ERR_OPENMODE:
4155 nfs4_state_mark_reclaim_nograce(server->nfs_client, state);
4156 err = 0;
4157 goto out;
4158 case -ENOMEM:
4159 case -NFS4ERR_DENIED:
4160 /* kill_proc(fl->fl_pid, SIGLOST, 1); */
4161 err = 0;
4162 goto out;
4163 case -NFS4ERR_DELAY:
4164 break;
4165 }
4125 err = nfs4_handle_exception(server, err, &exception); 4166 err = nfs4_handle_exception(server, err, &exception);
4126 } while (exception.retry); 4167 } while (exception.retry);
4127out: 4168out: