diff options
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 03b60c67ca7c..10946415de77 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -510,32 +510,30 @@ static int nfs4_open_reclaim(struct nfs4_state_owner *sp, struct nfs4_state *sta | |||
510 | return ret; | 510 | return ret; |
511 | } | 511 | } |
512 | 512 | ||
513 | static int _nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state) | 513 | static int _nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state, const nfs4_stateid *stateid) |
514 | { | 514 | { |
515 | struct nfs4_state_owner *sp = state->owner; | 515 | struct nfs4_state_owner *sp = state->owner; |
516 | struct nfs4_opendata *opendata; | 516 | struct nfs4_opendata *opendata; |
517 | int ret; | 517 | int ret; |
518 | 518 | ||
519 | if (!test_bit(NFS_DELEGATED_STATE, &state->flags)) | ||
520 | return 0; | ||
521 | opendata = nfs4_opendata_alloc(&ctx->path, sp, 0, NULL); | 519 | opendata = nfs4_opendata_alloc(&ctx->path, sp, 0, NULL); |
522 | if (opendata == NULL) | 520 | if (opendata == NULL) |
523 | return -ENOMEM; | 521 | return -ENOMEM; |
524 | opendata->o_arg.claim = NFS4_OPEN_CLAIM_DELEGATE_CUR; | 522 | opendata->o_arg.claim = NFS4_OPEN_CLAIM_DELEGATE_CUR; |
525 | memcpy(opendata->o_arg.u.delegation.data, state->stateid.data, | 523 | memcpy(opendata->o_arg.u.delegation.data, stateid->data, |
526 | sizeof(opendata->o_arg.u.delegation.data)); | 524 | sizeof(opendata->o_arg.u.delegation.data)); |
527 | ret = nfs4_open_recover(opendata, state); | 525 | ret = nfs4_open_recover(opendata, state); |
528 | nfs4_opendata_put(opendata); | 526 | nfs4_opendata_put(opendata); |
529 | return ret; | 527 | return ret; |
530 | } | 528 | } |
531 | 529 | ||
532 | int nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state) | 530 | int nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state, const nfs4_stateid *stateid) |
533 | { | 531 | { |
534 | struct nfs4_exception exception = { }; | 532 | struct nfs4_exception exception = { }; |
535 | struct nfs_server *server = NFS_SERVER(state->inode); | 533 | struct nfs_server *server = NFS_SERVER(state->inode); |
536 | int err; | 534 | int err; |
537 | do { | 535 | do { |
538 | err = _nfs4_open_delegation_recall(ctx, state); | 536 | err = _nfs4_open_delegation_recall(ctx, state, stateid); |
539 | switch (err) { | 537 | switch (err) { |
540 | case 0: | 538 | case 0: |
541 | return err; | 539 | return err; |