提交 18e624ad 编写于 作者: W Weston Andros Adamson 提交者: Trond Myklebust

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: NWeston Andros Adamson <dros@netapp.com>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 b25cd058
...@@ -318,7 +318,10 @@ xdr_shrink_bufhead(struct xdr_buf *buf, size_t len) ...@@ -318,7 +318,10 @@ xdr_shrink_bufhead(struct xdr_buf *buf, size_t len)
tail = buf->tail; tail = buf->tail;
head = buf->head; 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 */ /* Shift the tail first */
if (tail->iov_len != 0) { if (tail->iov_len != 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册