From: Al Viro <viro@zeniv.linux.org.uk>
To: David Howells <dhowells@redhat.com>
Cc: Steve French <smfrench@gmail.com>,
Shyam Prasad N <nspmangalore@gmail.com>,
Rohith Surabattula <rohiths.msft@gmail.com>,
Jeff Layton <jlayton@kernel.org>,
linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/7] iov_iter: Add a function to extract an iter's buffers to a bvec iter
Date: Fri, 26 Aug 2022 22:21:32 +0100 [thread overview]
Message-ID: <Ywk5XE6FvP5pI5d4@ZenIV> (raw)
In-Reply-To: <166126393409.708021.16165278011941496946.stgit@warthog.procyon.org.uk>
On Tue, Aug 23, 2022 at 03:12:14PM +0100, David Howells wrote:
> + ret = iov_iter_get_pages2(orig, pages, count, max_pages - npages,
> + &start);
> + if (ret < 0) {
> + pr_err("Couldn't get user pages (rc=%zd)\n", ret);
> + break;
> + }
> +
> + if (ret > count) {
> + pr_err("get_pages rc=%zd more than %zu\n", ret, count);
> + break;
> + }
> +
> + iov_iter_advance(orig, ret);
Have you even tested that? iov_iter_get_pages2() advances the iterator it had been
given. And no, it does *not* return more than it had been asked to, so the second
check is complete BS.
That's aside of the usefulness of the primitive in question...
next prev parent reply other threads:[~2022-08-26 21:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-23 14:12 [PATCH 0/7] smb3: Add iter helpers and use iov_iters down to the network transport David Howells
2022-08-23 14:12 ` [PATCH 1/7] iov_iter: Add a function to extract an iter's buffers to a bvec iter David Howells
2022-08-24 3:52 ` Christoph Hellwig
2022-08-26 21:21 ` Al Viro [this message]
2022-10-14 14:06 ` David Howells
2022-08-23 14:12 ` [PATCH 2/7] iov_iter: Add a general purpose iteration function David Howells
2022-08-26 21:35 ` Al Viro
2022-08-23 14:12 ` [PATCH 3/7] cifs: Add some helper functions David Howells
2022-08-23 14:12 ` [PATCH 4/7] cifs: Add a function to read into an iter from a socket David Howells
2022-09-24 2:50 ` Al Viro
2022-08-23 14:12 ` [PATCH 5/7] cifs: Change the I/O paths to use an iterator rather than a page list David Howells
2022-09-24 4:34 ` Al Viro
2022-08-23 14:12 ` [PATCH 6/7] cifs: Remove unused code David Howells
2022-08-23 14:12 ` [PATCH 7/7] cifs: Add some RDMA send tracepoints David Howells
-- strict thread matches above, loose matches on Subject: below --
2022-05-25 14:26 [PATCH 0/7] cifs: Use iov_iters down to the network transport David Howells
2022-05-25 14:26 ` [PATCH 1/7] iov_iter: Add a function to extract an iter's buffers to a bvec iter 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=Ywk5XE6FvP5pI5d4@ZenIV \
--to=viro@zeniv.linux.org.uk \
--cc=dhowells@redhat.com \
--cc=jlayton@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nspmangalore@gmail.com \
--cc=rohiths.msft@gmail.com \
--cc=smfrench@gmail.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;
as well as URLs for NNTP newsgroup(s).