Messages in this thread | | | Date | Fri, 26 Aug 2022 22:21:32 +0100 | From | Al Viro <> | Subject | Re: [PATCH 1/7] iov_iter: Add a function to extract an iter's buffers to a bvec iter |
| |
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...
| |