提交 1190bf06 编写于 作者: A Alex Elder 提交者: Sage Weil

libceph: fix broken data length assertions

It's OK for the result of a read to come back with fewer bytes than
were requested.  So don't trigger a BUG() in that case when
initializing the data cursor.

This resolves the first problem described in:
    http://tracker.ceph.com/issues/4598Signed-off-by: NAlex Elder <elder@inktank.com>
Reviewed-by: NSage Weil <sage@inktank.com>
上级 6644ed7b
......@@ -833,7 +833,7 @@ static void ceph_msg_data_pages_cursor_init(struct ceph_msg_data *data,
BUG_ON(!data->pages);
BUG_ON(!data->length);
BUG_ON(length != data->length);
BUG_ON(length > data->length); /* short reads are OK */
cursor->resid = length;
page_count = calc_pages_for(data->alignment, (u64)data->length);
......@@ -905,7 +905,7 @@ static void ceph_msg_data_pagelist_cursor_init(struct ceph_msg_data *data,
pagelist = data->pagelist;
BUG_ON(!pagelist);
BUG_ON(length != pagelist->length);
BUG_ON(length > pagelist->length); /* short reads are OK */
if (!length)
return; /* pagelist can be assigned but empty */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册