Commit 315c4418 authored by Mike Rapoport's avatar Mike Rapoport Committed by Andrei Vagin

lazy-pages: merge_iov_lists: fix corner case of empty destination

Signed-off-by: 's avatarMike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 82b7e843
......@@ -419,6 +419,14 @@ static void merge_iov_lists(struct list_head *src, struct list_head *dst)
{
struct lazy_iov *iov, *p, *n;
if (list_empty(src))
return;
if (list_empty(dst)) {
iov = list_first_entry(src, struct lazy_iov, l);
list_move(&iov->l, dst);
}
list_for_each_entry_safe(iov, n, src, l) {
list_for_each_entry(p, dst, l) {
if (iov->start < p->start) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment