diff options
Diffstat (limited to 'fs/nfsd/nfs4proc.c')
| -rw-r--r-- | fs/nfsd/nfs4proc.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index d71f14517b9c..361b4007d4a0 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
| @@ -162,19 +162,13 @@ do_open_fhandle(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_ | |||
| 162 | 162 | ||
| 163 | 163 | ||
| 164 | static inline int | 164 | static inline int |
| 165 | nfsd4_open(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open) | 165 | nfsd4_open(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open, struct nfs4_stateowner **replay_owner) |
| 166 | { | 166 | { |
| 167 | int status; | 167 | int status; |
| 168 | dprintk("NFSD: nfsd4_open filename %.*s op_stateowner %p\n", | 168 | dprintk("NFSD: nfsd4_open filename %.*s op_stateowner %p\n", |
| 169 | (int)open->op_fname.len, open->op_fname.data, | 169 | (int)open->op_fname.len, open->op_fname.data, |
| 170 | open->op_stateowner); | 170 | open->op_stateowner); |
| 171 | 171 | ||
| 172 | if (nfs4_in_grace() && open->op_claim_type != NFS4_OPEN_CLAIM_PREVIOUS) | ||
| 173 | return nfserr_grace; | ||
| 174 | |||
| 175 | if (!nfs4_in_grace() && open->op_claim_type == NFS4_OPEN_CLAIM_PREVIOUS) | ||
| 176 | return nfserr_no_grace; | ||
| 177 | |||
| 178 | /* This check required by spec. */ | 172 | /* This check required by spec. */ |
| 179 | if (open->op_create && open->op_claim_type != NFS4_OPEN_CLAIM_NULL) | 173 | if (open->op_create && open->op_claim_type != NFS4_OPEN_CLAIM_NULL) |
| 180 | return nfserr_inval; | 174 | return nfserr_inval; |
| @@ -244,8 +238,10 @@ nfsd4_open(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open | |||
| 244 | */ | 238 | */ |
| 245 | status = nfsd4_process_open2(rqstp, current_fh, open); | 239 | status = nfsd4_process_open2(rqstp, current_fh, open); |
| 246 | out: | 240 | out: |
| 247 | if (open->op_stateowner) | 241 | if (open->op_stateowner) { |
| 248 | nfs4_get_stateowner(open->op_stateowner); | 242 | nfs4_get_stateowner(open->op_stateowner); |
| 243 | *replay_owner = open->op_stateowner; | ||
| 244 | } | ||
| 249 | nfs4_unlock_state(); | 245 | nfs4_unlock_state(); |
| 250 | return status; | 246 | return status; |
| 251 | } | 247 | } |
| @@ -815,8 +811,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp, | |||
| 815 | op->status = nfsd4_access(rqstp, current_fh, &op->u.access); | 811 | op->status = nfsd4_access(rqstp, current_fh, &op->u.access); |
| 816 | break; | 812 | break; |
| 817 | case OP_CLOSE: | 813 | case OP_CLOSE: |
| 818 | op->status = nfsd4_close(rqstp, current_fh, &op->u.close); | 814 | op->status = nfsd4_close(rqstp, current_fh, &op->u.close, &replay_owner); |
| 819 | replay_owner = op->u.close.cl_stateowner; | ||
| 820 | break; | 815 | break; |
| 821 | case OP_COMMIT: | 816 | case OP_COMMIT: |
| 822 | op->status = nfsd4_commit(rqstp, current_fh, &op->u.commit); | 817 | op->status = nfsd4_commit(rqstp, current_fh, &op->u.commit); |
| @@ -837,15 +832,13 @@ nfsd4_proc_compound(struct svc_rqst *rqstp, | |||
| 837 | op->status = nfsd4_link(rqstp, current_fh, save_fh, &op->u.link); | 832 | op->status = nfsd4_link(rqstp, current_fh, save_fh, &op->u.link); |
| 838 | break; | 833 | break; |
| 839 | case OP_LOCK: | 834 | case OP_LOCK: |
| 840 | op->status = nfsd4_lock(rqstp, current_fh, &op->u.lock); | 835 | op->status = nfsd4_lock(rqstp, current_fh, &op->u.lock, &replay_owner); |
| 841 | replay_owner = op->u.lock.lk_stateowner; | ||
| 842 | break; | 836 | break; |
| 843 | case OP_LOCKT: | 837 | case OP_LOCKT: |
| 844 | op->status = nfsd4_lockt(rqstp, current_fh, &op->u.lockt); | 838 | op->status = nfsd4_lockt(rqstp, current_fh, &op->u.lockt); |
| 845 | break; | 839 | break; |
| 846 | case OP_LOCKU: | 840 | case OP_LOCKU: |
| 847 | op->status = nfsd4_locku(rqstp, current_fh, &op->u.locku); | 841 | op->status = nfsd4_locku(rqstp, current_fh, &op->u.locku, &replay_owner); |
| 848 | replay_owner = op->u.locku.lu_stateowner; | ||
| 849 | break; | 842 | break; |
| 850 | case OP_LOOKUP: | 843 | case OP_LOOKUP: |
| 851 | op->status = nfsd4_lookup(rqstp, current_fh, &op->u.lookup); | 844 | op->status = nfsd4_lookup(rqstp, current_fh, &op->u.lookup); |
| @@ -859,16 +852,13 @@ nfsd4_proc_compound(struct svc_rqst *rqstp, | |||
| 859 | op->status = nfs_ok; | 852 | op->status = nfs_ok; |
| 860 | break; | 853 | break; |
| 861 | case OP_OPEN: | 854 | case OP_OPEN: |
| 862 | op->status = nfsd4_open(rqstp, current_fh, &op->u.open); | 855 | op->status = nfsd4_open(rqstp, current_fh, &op->u.open, &replay_owner); |
| 863 | replay_owner = op->u.open.op_stateowner; | ||
| 864 | break; | 856 | break; |
| 865 | case OP_OPEN_CONFIRM: | 857 | case OP_OPEN_CONFIRM: |
| 866 | op->status = nfsd4_open_confirm(rqstp, current_fh, &op->u.open_confirm); | 858 | op->status = nfsd4_open_confirm(rqstp, current_fh, &op->u.open_confirm, &replay_owner); |
| 867 | replay_owner = op->u.open_confirm.oc_stateowner; | ||
| 868 | break; | 859 | break; |
| 869 | case OP_OPEN_DOWNGRADE: | 860 | case OP_OPEN_DOWNGRADE: |
| 870 | op->status = nfsd4_open_downgrade(rqstp, current_fh, &op->u.open_downgrade); | 861 | op->status = nfsd4_open_downgrade(rqstp, current_fh, &op->u.open_downgrade, &replay_owner); |
| 871 | replay_owner = op->u.open_downgrade.od_stateowner; | ||
| 872 | break; | 862 | break; |
| 873 | case OP_PUTFH: | 863 | case OP_PUTFH: |
| 874 | op->status = nfsd4_putfh(rqstp, current_fh, &op->u.putfh); | 864 | op->status = nfsd4_putfh(rqstp, current_fh, &op->u.putfh); |
