Re: [PATCH v3 5/5] lib: kunit_iov_iter: Add tests for extract_iter_to_sg
From: David Gow
Date: Tue Apr 21 2026 - 01:47:06 EST
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 lib/tests/kunit_iov_iter.c:1084
[13:20:40] Expected tail < bufsize, but
[13:20:40] tail == 1048576 (0x100000)
[13:20:40] bufsize == 1048576 (0x100000)
[13:20:40] [FAILED] iov_kunit_iter_to_sg_kvec
[13:20:40] # iov_kunit_iter_to_sg_bvec: ASSERTION FAILED at lib/tests/kunit_iov_iter.c:1084
[13:20:40] Expected tail < bufsize, but
[13:20:40] tail == 1048576 (0x100000)
[13:20:40] bufsize == 1048576 (0x100000)
[13:20:40] [FAILED] iov_kunit_iter_to_sg_bvec
[13:20:40] # iov_kunit_iter_to_sg_folioq: ASSERTION FAILED at lib/tests/kunit_iov_iter.c:1084
[13:20:40] Expected tail < bufsize, but
[13:20:40] tail == 1048576 (0x100000)
[13:20:40] bufsize == 1048576 (0x100000)
[13:20:40] [FAILED] iov_kunit_iter_to_sg_folioq
[13:20:40] # iov_kunit_iter_to_sg_xarray: ASSERTION FAILED at lib/tests/kunit_iov_iter.c:1084
[13:20:40] Expected tail < bufsize, but
[13:20:40] tail == 1048576 (0x100000)
[13:20:40] bufsize == 1048576 (0x100000)
[13:20:40] [FAILED] iov_kunit_iter_to_sg_xarray
[13:20:40] # iov_kunit_iter_to_sg_ubuf: ASSERTION FAILED at lib/tests/kunit_iov_iter.c:1084
[13:20:40] Expected tail < bufsize, but
[13:20:40] tail == 1048576 (0x100000)
[13:20:40] bufsize == 1048576 (0x100000)
[13:20:40] [FAILED] iov_kunit_iter_to_sg_ubuf
[13:20:40] # module: kunit_iov_iter
[13:20:40] # iov_iter: pass:12 fail:5 skip:0 total:17
[13:20:40] # Totals: pass:12 fail:5 skip:0 total:17
Any chance we could bump up the buffer size (at least) on systems with larger PAGE_SIZE?
Cheers,
-- David