Commit 1c5e28a8 authored by Andrey Filippov's avatar Andrey Filippov

Had to add get_page(cur_page); to avoid 'page dumped because: nonzero _refcount' BUG

parent 5a0e45c2
......@@ -1205,7 +1205,7 @@ ssize_t iov_iter_get_pages(struct iov_iter *i,
len = maxpages * PAGE_SIZE;
addr &= ~(PAGE_SIZE - 1);
n = DIV_ROUND_UP(len, PAGE_SIZE);
pr_debug("iterate_iovec(), addr =0x%08lx, len=%u, n=%u, write=%u", addr, len, n, (i->type & WRITE) != WRITE);
pr_debug("iterate_iovec(), v.iov_base=0x%08x, addr =0x%08lx, len=%u, n=%u, write=%u", (int) v.iov_base, addr, len, n, (i->type & WRITE) != WRITE);
res = get_user_pages_fast(addr, n, (i->type & WRITE) != WRITE, pages);
if (unlikely(res < 0)) {
pr_debug("iterate_iovec(), res = %d", res);
......@@ -1243,7 +1243,7 @@ ssize_t iov_iter_get_pages_elphel(struct iov_iter *i,
// *** Putting temporary address here
struct page * cur_page = (struct page * ) circbuf0_page0;
addr = 0;
pr_debug("circbuf0_page0 = 0x%08x, circbuf0_page0->compound_head=0x%08lx", (int) circbuf0_page0, circbuf0_page0->compound_head );
len = iov->iov_len + (*start = addr & (PAGE_SIZE - 1)); // to inlude beginning of the page - for now 0;
if (maxsize > i->count)
maxsize = i->count;
......@@ -1252,10 +1252,14 @@ ssize_t iov_iter_get_pages_elphel(struct iov_iter *i,
addr &= ~(PAGE_SIZE - 1);
n = DIV_ROUND_UP(len, PAGE_SIZE);
for (indx = 0; indx < n; indx++){
if ((cur_page -> compound_head) & 1){
pr_debug("**** COMPOUND HEAD! ****");
}
get_page(cur_page); // increments refcount
pages[indx] = cur_page++;
}
len -= *start;
pr_debug("iov_iter_get_pages_elphel()->0x%08x, n=%u", len, n);
pr_debug("iov_iter_get_pages_elphel()->0x%08x, n=%u, current->mm->map_count=%u", len, n, current->mm->map_count);
return len;
}
EXPORT_SYMBOL(iov_iter_get_pages_elphel);
......
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