summaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-05-24 17:39:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-24 17:39:20 -0400
commit5d22c5ab85e4de3c14d9e79eefc2835f4a8f9b2a (patch)
tree2aeaa4798bf856331609d90e5ccbb478014a66ce /fs/nfsd
parent0e01df100b6bf22a1de61b66657502a6454153c5 (diff)
parentc0cb8bf3a8e4bd82e640862cdd8891400405cb89 (diff)
Merge tag 'nfsd-4.7' of git://linux-nfs.org/~bfields/linux
Pull nfsd updates from Bruce Fields: "A very quiet cycle for nfsd, mainly just an RDMA update from Chuck Lever" * tag 'nfsd-4.7' of git://linux-nfs.org/~bfields/linux: sunrpc: fix stripping of padded MIC tokens svcrpc: autoload rdma module svcrdma: Generalize svc_rdma_xdr_decode_req() svcrdma: Eliminate code duplication in svc_rdma_recvfrom() svcrdma: Drain QP before freeing svcrdma_xprt svcrdma: Post Receives only for forward channel requests svcrdma: Remove superfluous line from rdma_read_chunks() svcrdma: svc_rdma_put_context() is invoked twice in Send error path svcrdma: Do not add XDR padding to xdr_buf page vector svcrdma: Support IPv6 with NFS/RDMA nfsd: handle seqid wraparound in nfsd4_preprocess_layout_stateid Remove unnecessary allocation
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs3xdr.c2
-rw-r--r--fs/nfsd/nfs4layouts.c2
-rw-r--r--fs/nfsd/nfs4state.c8
-rw-r--r--fs/nfsd/state.h5
4 files changed, 8 insertions, 9 deletions
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c
index 93d5853f8c99..dba2ff8eaa68 100644
--- a/fs/nfsd/nfs3xdr.c
+++ b/fs/nfsd/nfs3xdr.c
@@ -379,7 +379,7 @@ nfs3svc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p,
379 */ 379 */
380 hdr = (void*)p - rqstp->rq_arg.head[0].iov_base; 380 hdr = (void*)p - rqstp->rq_arg.head[0].iov_base;
381 dlen = rqstp->rq_arg.head[0].iov_len + rqstp->rq_arg.page_len 381 dlen = rqstp->rq_arg.head[0].iov_len + rqstp->rq_arg.page_len
382 - hdr; 382 + rqstp->rq_arg.tail[0].iov_len - hdr;
383 /* 383 /*
384 * Round the length of the data which was specified up to 384 * Round the length of the data which was specified up to
385 * the next multiple of XDR units and then compare that 385 * the next multiple of XDR units and then compare that
diff --git a/fs/nfsd/nfs4layouts.c b/fs/nfsd/nfs4layouts.c
index 825c7bc8d789..953c0755cb37 100644
--- a/fs/nfsd/nfs4layouts.c
+++ b/fs/nfsd/nfs4layouts.c
@@ -289,7 +289,7 @@ nfsd4_preprocess_layout_stateid(struct svc_rqst *rqstp,
289 289
290 status = nfserr_bad_stateid; 290 status = nfserr_bad_stateid;
291 mutex_lock(&ls->ls_mutex); 291 mutex_lock(&ls->ls_mutex);
292 if (stateid->si_generation > stid->sc_stateid.si_generation) 292 if (nfsd4_stateid_generation_after(stateid, &stid->sc_stateid))
293 goto out_unlock_stid; 293 goto out_unlock_stid;
294 if (layout_type != ls->ls_layout_type) 294 if (layout_type != ls->ls_layout_type)
295 goto out_unlock_stid; 295 goto out_unlock_stid;
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 0462eeddfff9..f5f82e145018 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4651,12 +4651,6 @@ grace_disallows_io(struct net *net, struct inode *inode)
4651 return opens_in_grace(net) && mandatory_lock(inode); 4651 return opens_in_grace(net) && mandatory_lock(inode);
4652} 4652}
4653 4653
4654/* Returns true iff a is later than b: */
4655static bool stateid_generation_after(stateid_t *a, stateid_t *b)
4656{
4657 return (s32)(a->si_generation - b->si_generation) > 0;
4658}
4659
4660static __be32 check_stateid_generation(stateid_t *in, stateid_t *ref, bool has_session) 4654static __be32 check_stateid_generation(stateid_t *in, stateid_t *ref, bool has_session)
4661{ 4655{
4662 /* 4656 /*
@@ -4670,7 +4664,7 @@ static __be32 check_stateid_generation(stateid_t *in, stateid_t *ref, bool has_s
4670 return nfs_ok; 4664 return nfs_ok;
4671 4665
4672 /* If the client sends us a stateid from the future, it's buggy: */ 4666 /* If the client sends us a stateid from the future, it's buggy: */
4673 if (stateid_generation_after(in, ref)) 4667 if (nfsd4_stateid_generation_after(in, ref))
4674 return nfserr_bad_stateid; 4668 return nfserr_bad_stateid;
4675 /* 4669 /*
4676 * However, we could see a stateid from the past, even from a 4670 * However, we could see a stateid from the past, even from a
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index c050c53036a6..986e51e5ceac 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -573,6 +573,11 @@ enum nfsd4_cb_op {
573 NFSPROC4_CLNT_CB_SEQUENCE, 573 NFSPROC4_CLNT_CB_SEQUENCE,
574}; 574};
575 575
576/* Returns true iff a is later than b: */
577static inline bool nfsd4_stateid_generation_after(stateid_t *a, stateid_t *b)
578{
579 return (s32)(a->si_generation - b->si_generation) > 0;
580}
576 581
577struct nfsd4_compound_state; 582struct nfsd4_compound_state;
578struct nfsd_net; 583struct nfsd_net;