From: "Christian A. Ehrhardt" <lk@c--e.de>
To: David Gow <david@davidgow.net>
Cc: David Howells <dhowells@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, Kees Cook <kees@kernel.org>,
Petr Mladek <pmladek@suse.com>
Subject: Re: [PATCH v3 5/5] lib: kunit_iov_iter: Add tests for extract_iter_to_sg
Date: Tue, 21 Apr 2026 08:30:27 +0200 [thread overview]
Message-ID: <aecZg9ika8HNiF5M@cae.in-ulm.de> (raw)
In-Reply-To: <34a81ec2-af84-465d-9b5e-7bb5bf01680f@davidgow.net>
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@redhat.com>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Signed-off-by: Christian A. Ehrhardt <lk@c--e.de>
> > ---
>
> 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
diff --git a/lib/tests/kunit_iov_iter.c b/lib/tests/kunit_iov_iter.c
index 37bd6eb25896..f02f7b7aa796 100644
--- a/lib/tests/kunit_iov_iter.c
+++ b/lib/tests/kunit_iov_iter.c
@@ -1128,7 +1128,7 @@ static void __init iov_kunit_iter_to_sg_kvec(struct kunit *test)
struct kvec kvec;
size_t bufsize;
- bufsize = 0x100000;
+ bufsize = 0x200000;
iov_kunit_iter_to_sg_init(test, bufsize, false, &data);
kvec.iov_base = data.buffer;
@@ -1146,7 +1146,7 @@ static void __init iov_kunit_iter_to_sg_bvec(struct kunit *test)
struct bio_vec *bvec;
struct iov_iter iter;
- bufsize = 0x100000;
+ bufsize = 0x200000;
iov_kunit_iter_to_sg_init(test, bufsize, false, &data);
bvec = kunit_kmalloc_array(test, data.npages, sizeof(*bvec),
@@ -1173,7 +1173,7 @@ static void __init iov_kunit_iter_to_sg_folioq(struct kunit *test)
struct iov_iter iter;
size_t bufsize;
- bufsize = 0x100000;
+ bufsize = 0x200000;
iov_kunit_iter_to_sg_init(test, bufsize, false, &data);
folioq = iov_kunit_create_folioq(test);
@@ -1190,7 +1190,7 @@ static void __init iov_kunit_iter_to_sg_xarray(struct kunit *test)
struct iov_iter iter;
size_t bufsize;
- bufsize = 0x100000;
+ bufsize = 0x200000;
iov_kunit_iter_to_sg_init(test, bufsize, false, &data);
xarray = iov_kunit_create_xarray(test);
@@ -1206,7 +1206,7 @@ static void __init iov_kunit_iter_to_sg_ubuf(struct kunit *test)
struct iov_iter iter;
size_t bufsize;
- bufsize = 0x100000;
+ bufsize = 0x200000;
iov_kunit_iter_to_sg_init(test, bufsize, true, &data);
iov_iter_ubuf(&iter, READ, data.ubuf, bufsize);
next prev parent reply other threads:[~2026-04-21 6:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-26 21:49 [PATCH v3 0/5] Fix bugs in extract_iter_to_sg() Christian A. Ehrhardt
2026-03-26 21:49 ` [PATCH v3 1/5] lib/scatterlist: Fix length calculations in extract_kvec_to_sg Christian A. Ehrhardt
2026-03-26 21:49 ` [PATCH v3 2/5] lib/scatterlist: Fix temp buffer in extract_user_to_sg() Christian A. Ehrhardt
2026-03-26 21:49 ` [PATCH v3 3/5] lib: kunit_iov_iter: Fix memory leaks Christian A. Ehrhardt
2026-03-26 21:49 ` [PATCH v3 4/5] lib: kunit_iov_iter: Improve error detection Christian A. Ehrhardt
2026-03-26 21:49 ` [PATCH v3 5/5] lib: kunit_iov_iter: Add tests for extract_iter_to_sg Christian A. Ehrhardt
2026-04-21 5:45 ` David Gow
2026-04-21 6:30 ` Christian A. Ehrhardt [this message]
2026-04-21 6:49 ` David Gow
2026-03-26 22:39 ` [PATCH v3 0/5] Fix bugs in extract_iter_to_sg() Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aecZg9ika8HNiF5M@cae.in-ulm.de \
--to=lk@c--e.de \
--cc=akpm@linux-foundation.org \
--cc=david@davidgow.net \
--cc=dhowells@redhat.com \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®