Skip to content

Commit 2d71340

Browse files
dhowellstorvalds
authored andcommitted
iov_iter: Kunit tests for copying to/from an iterator
Add some kunit tests for page extraction for ITER_BVEC, ITER_KVEC and ITER_XARRAY type iterators. ITER_UBUF and ITER_IOVEC aren't dealt with as they require userspace VM interaction. ITER_DISCARD isn't dealt with either as that does nothing. Signed-off-by: David Howells <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Christian Brauner <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Al Viro <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: John Hubbard <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent f741bd7 commit 2d71340

File tree

3 files changed

+549
-0
lines changed

3 files changed

+549
-0
lines changed

lib/Kconfig.debug

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2237,6 +2237,17 @@ config TEST_DIV64
22372237

22382238
If unsure, say N.
22392239

2240+
config TEST_IOV_ITER
2241+
tristate "Test iov_iter operation" if !KUNIT_ALL_TESTS
2242+
depends on KUNIT
2243+
default KUNIT_ALL_TESTS
2244+
help
2245+
Enable this to turn on testing of the operation of the I/O iterator
2246+
(iov_iter). This test is executed only once during system boot (so
2247+
affects only boot time), or at module load time.
2248+
2249+
If unsure, say N.
2250+
22402251
config KPROBES_SANITY_TEST
22412252
tristate "Kprobes sanity tests" if !KUNIT_ALL_TESTS
22422253
depends on DEBUG_KERNEL

lib/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ obj-$(CONFIG_TEST_BITOPS) += test_bitops.o
6464
CFLAGS_test_bitops.o += -Werror
6565
obj-$(CONFIG_CPUMASK_KUNIT_TEST) += cpumask_kunit.o
6666
obj-$(CONFIG_TEST_SYSCTL) += test_sysctl.o
67+
obj-$(CONFIG_TEST_IOV_ITER) += kunit_iov_iter.o
6768
obj-$(CONFIG_HASH_KUNIT_TEST) += test_hash.o
6869
obj-$(CONFIG_TEST_IDA) += test_ida.o
6970
obj-$(CONFIG_TEST_UBSAN) += test_ubsan.o

0 commit comments

Comments
 (0)