When there is no more data, ceph_msg_data_pagelist_advance() should
not move on to the next page.

Signed-off-by: Yan, Zheng <[email protected]>
---
 net/ceph/messenger.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 30efc5c..8859f2e 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -1004,6 +1004,9 @@ static bool ceph_msg_data_pagelist_advance(struct 
ceph_msg_data_cursor *cursor,
        if (!bytes || cursor->offset & ~PAGE_MASK)
                return false;   /* more bytes to process in the current page */
 
+       if (!cursor->resid)
+               return false;   /* no more data */
+
        /* Move on to the next page */
 
        BUG_ON(list_is_last(&cursor->page->lru, &pagelist->head));
-- 
1.8.5.3

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to