summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenny Halevy <bhalevy@panasas.com>2009-08-14 17:19:48 +0300
committerTrond Myklebust <Trond.Myklebust@netapp.com>2009-08-14 13:24:38 -0400
commit686841b3cc3a71918b45ed148be7a01a4f10e3f8 (patch)
tree131c3cac6eaf3348b4c240fce4285d657a52a2ac
parentc816fd3406462702dee2e3859e70132c3aab7c10 (diff)
downloadop-kernel-dev-686841b3cc3a71918b45ed148be7a01a4f10e3f8.zip
op-kernel-dev-686841b3cc3a71918b45ed148be7a01a4f10e3f8.tar.gz
nfs: nfs4xdr: introduce print_overflow_msg
Part fo the nfs4xdr cleanup. READ_BUF will go away. Signed-off-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/nfs4xdr.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 0c26bb2..8255ec7 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -2441,14 +2441,18 @@ static int nfs4_xdr_enc_get_lease_time(struct rpc_rqst *req, uint32_t *p,
#define READ_BUF(nbytes) do { \
p = xdr_inline_decode(xdr, nbytes); \
if (unlikely(!p)) { \
- dprintk("nfs: %s: prematurely hit end of receive" \
- " buffer\n", __func__); \
- dprintk("nfs: %s: xdr->p=%p, bytes=%u, xdr->end=%p\n", \
- __func__, xdr->p, nbytes, xdr->end); \
+ print_overflow_msg(__func__, xdr); \
return -EIO; \
} \
} while (0)
+static void print_overflow_msg(const char *func, const struct xdr_stream *xdr)
+{
+ dprintk("nfs: %s: prematurely hit end of receive buffer. "
+ "Remaining buffer length is %tu words.\n",
+ func, xdr->end - xdr->p);
+}
+
static int decode_opaque_inline(struct xdr_stream *xdr, unsigned int *len, char **string)
{
__be32 *p;
OpenPOWER on IntegriCloud