diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/nfs4xdr.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 0c26bb2d43d9..8255ec7079d4 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, | |||
2441 | #define READ_BUF(nbytes) do { \ | 2441 | #define READ_BUF(nbytes) do { \ |
2442 | p = xdr_inline_decode(xdr, nbytes); \ | 2442 | p = xdr_inline_decode(xdr, nbytes); \ |
2443 | if (unlikely(!p)) { \ | 2443 | if (unlikely(!p)) { \ |
2444 | dprintk("nfs: %s: prematurely hit end of receive" \ | 2444 | print_overflow_msg(__func__, xdr); \ |
2445 | " buffer\n", __func__); \ | ||
2446 | dprintk("nfs: %s: xdr->p=%p, bytes=%u, xdr->end=%p\n", \ | ||
2447 | __func__, xdr->p, nbytes, xdr->end); \ | ||
2448 | return -EIO; \ | 2445 | return -EIO; \ |
2449 | } \ | 2446 | } \ |
2450 | } while (0) | 2447 | } while (0) |
2451 | 2448 | ||
2449 | static void print_overflow_msg(const char *func, const struct xdr_stream *xdr) | ||
2450 | { | ||
2451 | dprintk("nfs: %s: prematurely hit end of receive buffer. " | ||
2452 | "Remaining buffer length is %tu words.\n", | ||
2453 | func, xdr->end - xdr->p); | ||
2454 | } | ||
2455 | |||
2452 | static int decode_opaque_inline(struct xdr_stream *xdr, unsigned int *len, char **string) | 2456 | static int decode_opaque_inline(struct xdr_stream *xdr, unsigned int *len, char **string) |
2453 | { | 2457 | { |
2454 | __be32 *p; | 2458 | __be32 *p; |