From: Christoph Hellwig <hch@lst.de>
To: David Howells <dhowells@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>, Keith Busch <kbusch@kernel.org>,
Hannes Reinecke <hare@kernel.org>, Christoph Hellwig <hch@lst.de>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Paulo Alcantara <pc@manguebit.org>,
netfs@lists.linux.dev, linux-block@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] block: Fix start and length check added to iov_iter_extract_bvecs()
Date: Wed, 9 Sep 2026 08:28:27 +0200 [thread overview]
Message-ID: <20260909062827.GA29874@lst.de> (raw)
In-Reply-To: <1456602.1788783694@warthog.procyon.org.uk>
On Mon, Sep 07, 2026 at 01:21:34PM +0100, David Howells wrote:
> index 6665372ecf71..5e9f9e2c30b1 100644
> --- a/lib/iov_iter.c
> +++ b/lib/iov_iter.c
> @@ -1921,15 +1921,29 @@ ssize_t iov_iter_extract_bvecs(struct iov_iter *iter, struct bio_vec *bv,
> unsigned short max_vecs, unsigned mem_align_mask,
> iov_iter_extraction_t extraction_flags)
> {
> - unsigned long start = (unsigned long)iter_iov_addr(iter);
> unsigned short entries_left = max_vecs - *nr_vecs;
> unsigned short nr_pages, i = 0;
> size_t left, offset, len;
> struct page **pages;
> ssize_t size;
>
> - if ((start | iter_iov_len(iter)) & mem_align_mask)
> + /*
> + * DMA engines typically have both memory address and length alignment
> + * requirements, so check these against the alignment mask. For UBUF,
> + * IOVEC and KVEC, only the current segment will be drawn from; for
> + * everything else we might draw from multiple segments, so we need to
> + * check those too.
I have a bit of a hard time understanding what "draw from" means here?
I guess you mean that iov_iter_extract_pages only operates on a single
iov/kvec/bvec but could touch multiple segments for the others?
Maybe try to explain that without introducing new terminology?
prev parent reply other threads:[~2026-09-09 6:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-07 12:21 David Howells
2026-09-09 6:28 ` Christoph Hellwig [this message]
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=20260909062827.GA29874@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=dhowells@redhat.com \
--cc=hare@kernel.org \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netfs@lists.linux.dev \
--cc=pc@manguebit.org \
--cc=viro@zeniv.linux.org.uk \
/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®