All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libceph: fix oops in ceph_msg_data_pagelist_advance()
@ 2014-03-22 22:54 Yan, Zheng
  2014-03-22 23:10 ` Alex Elder
  0 siblings, 1 reply; 3+ messages in thread
From: Yan, Zheng @ 2014-03-22 22:54 UTC (permalink / raw)
  To: ceph-devel; +Cc: Yan, Zheng

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

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-22 23:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-22 22:54 [PATCH] libceph: fix oops in ceph_msg_data_pagelist_advance() Yan, Zheng
2014-03-22 23:10 ` Alex Elder
2014-03-22 23:38   ` Yan, Zheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.