diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-12-07 12:52:23 -0800 |
---|---|---|
committer | Luis Henriques <luis.henriques@canonical.com> | 2016-01-11 10:50:19 +0000 |
commit | ea312c492a05bca42429aa024d9ef2bb3f3d61d6 (patch) | |
tree | b18c4946e10b037ec205f6b87b45def3c9f30ed5 /fs/nfs/callback_xdr.c | |
parent | 169c69de70e8cc788dfaff4e9858db525a5fd2dd (diff) | |
download | linux-stable-ea312c492a05bca42429aa024d9ef2bb3f3d61d6.tar.gz linux-stable-ea312c492a05bca42429aa024d9ef2bb3f3d61d6.tar.bz2 linux-stable-ea312c492a05bca42429aa024d9ef2bb3f3d61d6.zip |
SUNRPC: Fix callback channel
commit 756b9b37cfb2e3dc76b2e43a8c097402ac736e07 upstream.
The NFSv4.1 callback channel is currently broken because the receive
message will keep shrinking because the backchannel receive buffer size
never gets reset.
The easiest solution to this problem is instead of changing the receive
buffer, to rather adjust the copied request.
Fixes: 38b7631fbe42 ("nfs4: limit callback decoding to received bytes")
Cc: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Diffstat (limited to 'fs/nfs/callback_xdr.c')
-rw-r--r-- | fs/nfs/callback_xdr.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c index 1e366354a193..02f8d09e119f 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c @@ -76,8 +76,7 @@ static __be32 *read_buf(struct xdr_stream *xdr, int nbytes) p = xdr_inline_decode(xdr, nbytes); if (unlikely(p == NULL)) - printk(KERN_WARNING "NFS: NFSv4 callback reply buffer overflowed " - "or truncated request.\n"); + printk(KERN_WARNING "NFS: NFSv4 callback reply buffer overflowed!\n"); return p; } @@ -893,7 +892,6 @@ static __be32 nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *r struct cb_compound_hdr_arg hdr_arg = { 0 }; struct cb_compound_hdr_res hdr_res = { NULL }; struct xdr_stream xdr_in, xdr_out; - struct xdr_buf *rq_arg = &rqstp->rq_arg; __be32 *p, status; struct cb_process_state cps = { .drc_status = 0, @@ -905,8 +903,7 @@ static __be32 nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *r dprintk("%s: start\n", __func__); - rq_arg->len = rq_arg->head[0].iov_len + rq_arg->page_len; - xdr_init_decode(&xdr_in, rq_arg, rq_arg->head[0].iov_base); + xdr_init_decode(&xdr_in, &rqstp->rq_arg, rqstp->rq_arg.head[0].iov_base); p = (__be32*)((char *)rqstp->rq_res.head[0].iov_base + rqstp->rq_res.head[0].iov_len); xdr_init_encode(&xdr_out, &rqstp->rq_res, p); |