Skip to content

Commit

Permalink
SUNRPC: remove BUG_ON in xdr_shrink_bufhead
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Weston Andros Adamson authored and Trond Myklebust committed Nov 4, 2012
1 parent b25cd05 commit 18e624a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/sunrpc/xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,10 @@ xdr_shrink_bufhead(struct xdr_buf *buf, size_t len)

tail = buf->tail;
head = buf->head;
BUG_ON (len > head->iov_len);

WARN_ON_ONCE(len > head->iov_len);
if (len > head->iov_len)
len = head->iov_len;

/* Shift the tail first */
if (tail->iov_len != 0) {
Expand Down

0 comments on commit 18e624a

Please sign in to comment.