diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/callback_proc.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index 631b44c1439b..49c4b548b4d0 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c | |||
@@ -280,17 +280,12 @@ out: | |||
280 | return status; | 280 | return status; |
281 | } | 281 | } |
282 | 282 | ||
283 | /* FIXME: referring calls should be processed */ | ||
284 | unsigned nfs4_callback_sequence(struct cb_sequenceargs *args, | 283 | unsigned nfs4_callback_sequence(struct cb_sequenceargs *args, |
285 | struct cb_sequenceres *res) | 284 | struct cb_sequenceres *res) |
286 | { | 285 | { |
287 | struct nfs_client *clp; | 286 | struct nfs_client *clp; |
288 | int i, status; | 287 | int i, status; |
289 | 288 | ||
290 | for (i = 0; i < args->csa_nrclists; i++) | ||
291 | kfree(args->csa_rclists[i].rcl_refcalls); | ||
292 | kfree(args->csa_rclists); | ||
293 | |||
294 | status = htonl(NFS4ERR_BADSESSION); | 289 | status = htonl(NFS4ERR_BADSESSION); |
295 | clp = find_client_with_session(args->csa_addr, 4, &args->csa_sessionid); | 290 | clp = find_client_with_session(args->csa_addr, 4, &args->csa_sessionid); |
296 | if (clp == NULL) | 291 | if (clp == NULL) |
@@ -301,6 +296,16 @@ unsigned nfs4_callback_sequence(struct cb_sequenceargs *args, | |||
301 | if (status) | 296 | if (status) |
302 | goto out_putclient; | 297 | goto out_putclient; |
303 | 298 | ||
299 | /* | ||
300 | * Check for pending referring calls. If a match is found, a | ||
301 | * related callback was received before the response to the original | ||
302 | * call. | ||
303 | */ | ||
304 | if (referring_call_exists(clp, args->csa_nrclists, args->csa_rclists)) { | ||
305 | status = htonl(NFS4ERR_DELAY); | ||
306 | goto out_putclient; | ||
307 | } | ||
308 | |||
304 | memcpy(&res->csr_sessionid, &args->csa_sessionid, | 309 | memcpy(&res->csr_sessionid, &args->csa_sessionid, |
305 | sizeof(res->csr_sessionid)); | 310 | sizeof(res->csr_sessionid)); |
306 | res->csr_sequenceid = args->csa_sequenceid; | 311 | res->csr_sequenceid = args->csa_sequenceid; |
@@ -311,6 +316,10 @@ unsigned nfs4_callback_sequence(struct cb_sequenceargs *args, | |||
311 | out_putclient: | 316 | out_putclient: |
312 | nfs_put_client(clp); | 317 | nfs_put_client(clp); |
313 | out: | 318 | out: |
319 | for (i = 0; i < args->csa_nrclists; i++) | ||
320 | kfree(args->csa_rclists[i].rcl_refcalls); | ||
321 | kfree(args->csa_rclists); | ||
322 | |||
314 | dprintk("%s: exit with status = %d\n", __func__, ntohl(status)); | 323 | dprintk("%s: exit with status = %d\n", __func__, ntohl(status)); |
315 | res->csr_status = status; | 324 | res->csr_status = status; |
316 | return res->csr_status; | 325 | return res->csr_status; |