Re: [PATCH v10 2/8] iov_iter: Add a function to extract a page list from an iterator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



iov_iter_extract_kvec_pages() isn't quite right.  The problem is that there's
not currently any path by which it can be tested, as currently
iov_iter_get_pages*() balk at it, but I managed to do that by piggybacking
some testing code on my cifs patches.

The attached change fixes the problem.

David

--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -2080,9 +2080,9 @@ static ssize_t iov_iter_extract_kvec_pages(struct iov_iter *i,
 		skip = 0;
 	}
 
-	offset = skip % PAGE_SIZE;
+	kaddr = i->kvec->iov_base + skip;
+	offset = (unsigned long)kaddr & ~PAGE_MASK;
 	*offset0 = offset;
-	kaddr = i->kvec->iov_base;
 
 	maxpages = want_pages_array(pages, maxsize, offset, maxpages);
 	if (!maxpages)






[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux