diff options
author | J. Bruce Fields <bfields@redhat.com> | 2012-12-04 18:03:46 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-12-17 16:02:41 -0500 |
commit | 9b3234b9220aae5387b60bc35a424ab6748b2b59 (patch) | |
tree | eeaf7761a957cd3acdd6c55a91587b28998d0bd9 /fs/nfsd/nfs4proc.c | |
parent | 3a28e331115be5130fe061e6b4183b29385116a6 (diff) | |
download | lwn-9b3234b9220aae5387b60bc35a424ab6748b2b59.tar.gz lwn-9b3234b9220aae5387b60bc35a424ab6748b2b59.zip |
nfsd4: disable zero-copy on non-final read ops
To ensure ordering of read data with any following operations, turn off
zero copy if the read is not the final operation in the compound.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4proc.c')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index bd67f4d6dfc6..2a2d9b06a413 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -692,6 +692,17 @@ nfsd4_read(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, if (read->rd_offset >= OFFSET_MAX) return nfserr_inval; + /* + * If we do a zero copy read, then a client will see read data + * that reflects the state of the file *after* performing the + * following compound. + * + * To ensure proper ordering, we therefore turn off zero copy if + * the client wants us to do more in this compound: + */ + if (!nfsd4_last_compound_op(rqstp)) + rqstp->rq_splice_ok = false; + nfs4_lock_state(); /* check stateid */ if ((status = nfs4_preprocess_stateid_op(SVC_NET(rqstp), |