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 Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux