Re: [PATCH 1/7] iov_iter: Add a function to extract an iter's buffers to a bvec iter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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...



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux