diff options
author | J. Bruce Fields <bfields@redhat.com> | 2012-03-06 14:35:16 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-03-06 18:13:23 -0500 |
commit | 1255a8f36cb16a02540bdad91c0bc0971b9fb429 (patch) | |
tree | 5e1d41dbe476ad5845bb17823a55a27a85ff2f93 /fs/nfsd/nfs4state.c | |
parent | d24433cdc91c0ed15938d2a6ee9e3e1b00fcfaa3 (diff) |
nfsd4: don't set cl_firststate on first reclaim in 4.1 case
We set cl_firststate when we first decide that a client will be
permitted to reclaim state on next boot. This happens:
- for new 4.0 clients, when they confirm their first open
- for returning 4.0 clients, when they reclaim their first open
- for 4.1+ clients, when they perform reclaim_complete
We also use cl_firststate to decide whether a reclaim_complete has
already been performed, in the 4.1+ case.
We were setting it on 4.1 open reclaims, which caused spurious
COMPLETE_ALREADY errors on RECLAIM_COMPLETE from an nfs4.1 client with
anything to reclaim.
Reported-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r-- | fs/nfsd/nfs4state.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 967c677c2e54..207c3bd266aa 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -2778,10 +2778,15 @@ nfs4_upgrade_open(struct svc_rqst *rqstp, struct nfs4_file *fp, struct svc_fh *c | |||
2778 | 2778 | ||
2779 | 2779 | ||
2780 | static void | 2780 | static void |
2781 | nfs4_set_claim_prev(struct nfsd4_open *open) | 2781 | nfs4_set_claim_prev(struct nfsd4_open *open, bool has_session) |
2782 | { | 2782 | { |
2783 | open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED; | 2783 | open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED; |
2784 | open->op_openowner->oo_owner.so_client->cl_firststate = 1; | 2784 | /* |
2785 | * On a 4.1+ client, we don't create a state record for a client | ||
2786 | * until it performs RECLAIM_COMPLETE: | ||
2787 | */ | ||
2788 | if (!has_session) | ||
2789 | open->op_openowner->oo_owner.so_client->cl_firststate = 1; | ||
2785 | } | 2790 | } |
2786 | 2791 | ||
2787 | /* Should we give out recallable state?: */ | 2792 | /* Should we give out recallable state?: */ |
@@ -3044,7 +3049,7 @@ out: | |||
3044 | if (fp) | 3049 | if (fp) |
3045 | put_nfs4_file(fp); | 3050 | put_nfs4_file(fp); |
3046 | if (status == 0 && open->op_claim_type == NFS4_OPEN_CLAIM_PREVIOUS) | 3051 | if (status == 0 && open->op_claim_type == NFS4_OPEN_CLAIM_PREVIOUS) |
3047 | nfs4_set_claim_prev(open); | 3052 | nfs4_set_claim_prev(open, nfsd4_has_session(&resp->cstate)); |
3048 | /* | 3053 | /* |
3049 | * To finish the open response, we just need to set the rflags. | 3054 | * To finish the open response, we just need to set the rflags. |
3050 | */ | 3055 | */ |