linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Jens Axboe <axboe@kernel.dk>, Al Viro <viro@zeniv.linux.org.uk>,
	Christoph Hellwig <hch@lst.de>
Cc: David Howells <dhowells@redhat.com>,
	Matthew Wilcox <willy@infradead.org>,
	Christian Brauner <brauner@kernel.org>,
	David Hildenbrand <david@redhat.com>,
	John Hubbard <jhubbard@nvidia.com>,
	Jeff Layton <jlayton@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org,
	linux-kselftest@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 0/3] iov_iter: Add kunit tests and fix iov_iter_extract_pages()
Date: Fri,  8 Sep 2023 17:03:19 +0100	[thread overview]
Message-ID: <20230908160322.1714302-1-dhowells@redhat.com> (raw)

Hi Jens, Christoph, Al,

Here are two patches to add some kunit tests for the iov_iter stuff and a
patch to fix a couple of bugs found by these tests.

It's by no means comprehensive, but it does at least test the basic
copy_to_iter(), copy_from_iter() and iov_iter_extract_pages() for
ITER_KVEC, ITER_BVEC and ITER_XARRAY.

I've left ITER_UBUF and ITER_IOVEC untested for now as they require
userspace VM interaction and I'm not sure if that's possible under kunit
tests.  I've also left ITER_DISCARD for the moment as that does nothing and
can't be extracted.

The kunit tests should also perhaps be using folios rather than pages, but
for the moment I'm using pages because I'm using vmap() and also
iov_iter_extract_pages() doesn't yet have a folio equivalent.

I've pushed the patches here also:

	https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=iov-fixes

David

David Howells (3):
  iov_iter: Fix iov_iter_extract_pages()
  iov_iter: Kunit tests for copying to/from an iterator
  iov_iter: Kunit tests for page extraction

 lib/Kconfig.debug    |  11 +
 lib/Makefile         |   1 +
 lib/iov_iter.c       |  30 +-
 lib/kunit_iov_iter.c | 777 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 804 insertions(+), 15 deletions(-)
 create mode 100644 lib/kunit_iov_iter.c


             reply	other threads:[~2023-09-08 16:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-08 16:03 David Howells [this message]
2023-09-08 16:03 ` [PATCH 1/3] iov_iter: Fix iov_iter_extract_pages() David Howells
2023-09-09 11:27   ` Christoph Hellwig
2023-09-08 16:03 ` [PATCH 2/3] iov_iter: Kunit tests for copying to/from an iterator David Howells
2023-09-09 11:30   ` Christoph Hellwig
2023-09-08 16:03 ` [PATCH 3/3] iov_iter: Kunit tests for page extraction David Howells

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=20230908160322.1714302-1-dhowells@redhat.com \
    --to=dhowells@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=david@redhat.com \
    --cc=hch@lst.de \
    --cc=jhubbard@nvidia.com \
    --cc=jlayton@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).