Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18e624ad authored by Weston Andros Adamson's avatar Weston Andros Adamson Committed by Trond Myklebust
Browse files

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: default avatarWeston Andros Adamson <dros@netapp.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent b25cd058
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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) {