aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorWeston Andros Adamson <dros@netapp.com>2012-10-23 10:43:42 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-11-04 14:43:42 -0500
commit18e624ad0374f3b1092530f978301611f88e45b3 (patch)
tree16f0c87a18a598289acfa5c59ab7e3b8c4308759 /net/sunrpc
parentb25cd058f25ea2054351bbe501956002cd8ed4c5 (diff)
SUNRPC: remove BUG_ON in xdr_shrink_bufhead
Replace bounds checking BUG_ON() with a WARN_ON_ONCE() and resetting the requested len to the max. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/xdr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
index 08f50afd5f2a..56055632f151 100644
--- a/net/sunrpc/xdr.c
+++ b/net/sunrpc/xdr.c
@@ -318,7 +318,10 @@ xdr_shrink_bufhead(struct xdr_buf *buf, size_t len)
318 318
319 tail = buf->tail; 319 tail = buf->tail;
320 head = buf->head; 320 head = buf->head;
321 BUG_ON (len > head->iov_len); 321
322 WARN_ON_ONCE(len > head->iov_len);
323 if (len > head->iov_len)
324 len = head->iov_len;
322 325
323 /* Shift the tail first */ 326 /* Shift the tail first */
324 if (tail->iov_len != 0) { 327 if (tail->iov_len != 0) {