diff mbox series

[next] iov_iter: fix copy_page_from_iter_atomic()

Message ID 356ef449-44bf-539f-76c0-7fe9c6e713bb@google.com (mailing list archive)
State New, archived
Headers show
Series [next] iov_iter: fix copy_page_from_iter_atomic() | expand

Commit Message

Hugh Dickins Oct. 7, 2023, 4:32 a.m. UTC
[PATCH next] iov_iter: fix copy_page_from_iter_atomic()

Trying to test tmpfs on latest linux-next, copying and building kernel
trees, huge pages, and swapping while swapping off involved: lots of
cp: error writing '/tmp/2624/Documentation/fb/vesafb.txt': Bad address
cp: error writing '/tmp/2624/arch/mips/math-emu/dp_fsp.c': Bad address
etc.

Bisection leads to next-20231006's 376fdc4552f1 ("iov_iter:
Don't deal with iter->copy_mc in memcpy_from_iter_mc()") from vfs.git.
The tweak below makes it healthy again: please feel free to fold in.

Signed-off-by: Hugh Dickins <hughd@google.com>

Comments

David Howells Oct. 7, 2023, 7:29 a.m. UTC | #1
Hugh Dickins <hughd@google.com> wrote:

> -		__copy_from_iter(p, n, i);
> +		n = __copy_from_iter(p, n, i);

Yeah, that looks right.  Can you fold it in, Christian?

David
Christian Brauner Oct. 9, 2023, 7:36 a.m. UTC | #2
On Sat, Oct 07, 2023 at 08:29:14AM +0100, David Howells wrote:
> Hugh Dickins <hughd@google.com> wrote:
> 
> > -		__copy_from_iter(p, n, i);
> > +		n = __copy_from_iter(p, n, i);
> 
> Yeah, that looks right.  Can you fold it in, Christian?

Of course. Folded into
c9eec08bac96 ("iov_iter: Don't deal with iter->copy_mc in memcpy_from_iter_mc()")
on vfs.iov_iter.
diff mbox series

Patch

--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -497,7 +497,7 @@  size_t copy_page_from_iter_atomic(struct
 		}
 
 		p = kmap_atomic(page) + offset;
-		__copy_from_iter(p, n, i);
+		n = __copy_from_iter(p, n, i);
 		kunmap_atomic(p);
 		copied += n;
 		offset += n;