diff options
Diffstat (limited to 'fs/nfsd/nfs4xdr.c')
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 20c5e3db0660..00ed16a18497 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -3057,6 +3057,7 @@ nfsd4_encode_sequence(struct nfsd4_compoundres *resp, int nfserr, | |||
3057 | WRITE32(0); | 3057 | WRITE32(0); |
3058 | 3058 | ||
3059 | ADJUST_ARGS(); | 3059 | ADJUST_ARGS(); |
3060 | resp->cstate.datap = p; /* DRC cache data pointer */ | ||
3060 | return 0; | 3061 | return 0; |
3061 | } | 3062 | } |
3062 | 3063 | ||
@@ -3159,7 +3160,7 @@ static int nfsd4_check_drc_limit(struct nfsd4_compoundres *resp) | |||
3159 | return status; | 3160 | return status; |
3160 | 3161 | ||
3161 | session = resp->cstate.session; | 3162 | session = resp->cstate.session; |
3162 | if (session == NULL || slot->sl_cache_entry.ce_cachethis == 0) | 3163 | if (session == NULL || slot->sl_cachethis == 0) |
3163 | return status; | 3164 | return status; |
3164 | 3165 | ||
3165 | if (resp->opcnt >= args->opcnt) | 3166 | if (resp->opcnt >= args->opcnt) |
@@ -3284,6 +3285,7 @@ nfs4svc_encode_compoundres(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_compo | |||
3284 | /* | 3285 | /* |
3285 | * All that remains is to write the tag and operation count... | 3286 | * All that remains is to write the tag and operation count... |
3286 | */ | 3287 | */ |
3288 | struct nfsd4_compound_state *cs = &resp->cstate; | ||
3287 | struct kvec *iov; | 3289 | struct kvec *iov; |
3288 | p = resp->tagp; | 3290 | p = resp->tagp; |
3289 | *p++ = htonl(resp->taglen); | 3291 | *p++ = htonl(resp->taglen); |
@@ -3297,15 +3299,10 @@ nfs4svc_encode_compoundres(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_compo | |||
3297 | iov = &rqstp->rq_res.head[0]; | 3299 | iov = &rqstp->rq_res.head[0]; |
3298 | iov->iov_len = ((char*)resp->p) - (char*)iov->iov_base; | 3300 | iov->iov_len = ((char*)resp->p) - (char*)iov->iov_base; |
3299 | BUG_ON(iov->iov_len > PAGE_SIZE); | 3301 | BUG_ON(iov->iov_len > PAGE_SIZE); |
3300 | if (nfsd4_has_session(&resp->cstate)) { | 3302 | if (nfsd4_has_session(cs) && cs->status != nfserr_replay_cache) { |
3301 | if (resp->cstate.status == nfserr_replay_cache && | 3303 | nfsd4_store_cache_entry(resp); |
3302 | !nfsd4_not_cached(resp)) { | 3304 | dprintk("%s: SET SLOT STATE TO AVAILABLE\n", __func__); |
3303 | iov->iov_len = resp->cstate.iovlen; | 3305 | resp->cstate.slot->sl_inuse = false; |
3304 | } else { | ||
3305 | nfsd4_store_cache_entry(resp); | ||
3306 | dprintk("%s: SET SLOT STATE TO AVAILABLE\n", __func__); | ||
3307 | resp->cstate.slot->sl_inuse = 0; | ||
3308 | } | ||
3309 | nfsd4_put_session(resp->cstate.session); | 3306 | nfsd4_put_session(resp->cstate.session); |
3310 | } | 3307 | } |
3311 | return 1; | 3308 | return 1; |