Re: [PATCH v3 5/5] lib: kunit_iov_iter: Add tests for extract_iter_to_sg
From: David Gow
Date: Tue Apr 21 2026 - 02:51:02 EST
Le 21/04/2026 à 14:30, Christian A. Ehrhardt a écrit :
Hi David,
On Tue, Apr 21, 2026 at 01:45:33PM +0800, David Gow wrote:
Le 27/03/2026 à 05:49, Christian A. Ehrhardt a écrit :
Add test cases that test extract_iter_to_sg.
For each iterator type an iterator is loaded with a suitable
buffer. The iterator is then extracted to a scatterlist with
multiple calls to extract_iter_to_sg. The final scatterlist
is copied into a scratch buffer.
The test passes if the scratch buffer contains the same data
as the original buffer.
The new tests demonstrate bugs in extract_iter_to_sg
for kvec and user iterators that are fixed by the previous
commits.
Cc: David Howells <dhowells@xxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Christian A. Ehrhardt <lk@xxxxxxx>
---
Hmm... this is failing on powerpc, where PAGE_SIZE is 64k:
[13:20:40] # iov_kunit_iter_to_sg_kvec: ASSERTION FAILED at
Sorry about that! I wasn't aware of the large page size on powerpc.
This should fix it. I will prepare a proper patch but it would
be cool if you could verify that it actually helps.
Best regards,
Christian
Works here, thanks. Sorry I didn't pick it before it went in.
I tested with:
./tools/testing/kunit/kunit.py run --arch powerpc --cross_compile powerpc64-suse-linux-
(But it'll obviously need some minor tweaks for non-SUSE distros…)
Cheers,
-- David