lkml.org 
[lkml]   [2022]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/1] s390/crash: allow multi-segment iterators
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?

\
 
 \ /
  Last update: 2022-07-07 21:07    [W:0.055 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site