Re: [PATCH v2 1/1] s390/crash: allow multi-segment iterators
From: Matthew Wilcox
Date: Thu Jul 07 2022 - 15:06:35 EST
On Thu, Jul 07, 2022 at 02:31:44PM +0100, Al Viro wrote:
> > @@ -73,10 +73,9 @@ int memcpy_hsa_user(void __user *dest, unsigned long src, size_t count)
> > }
> > offset = src % PAGE_SIZE;
> > bytes = min(PAGE_SIZE - offset, count);
> > - if (copy_to_user(dest, hsa_buf + offset, bytes))
> > + if (copy_to_iter(hsa_buf + offset, bytes, iter) != bytes)
> > return -EFAULT;
>
> Umm... Then you want iov_iter_revert() on short copy...
... maybe better to change the calling convention to return the short
write and have the caller do it if they care?