iov_iter: Introduce fault_in_iov_iter_writeable
authorAndreas Gruenbacher <agruenba@redhat.com>
Thu, 14 Apr 2022 22:28:41 +0000 (06:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 May 2022 15:22:29 +0000 (17:22 +0200)
commit1d91c912e7d14e147183757f48e709f8154f9de3
tree6bb7b6709dec6561636c0b91662eac2e9186a341
parent30e66b1dfcbbe409c76500a77ecd20b3cf5b8fa5
iov_iter: Introduce fault_in_iov_iter_writeable

commit cdd591fc86e38ad3899196066219fbbd845f3162 upstream

Introduce a new fault_in_iov_iter_writeable helper for safely faulting
in an iterator for writing.  Uses get_user_pages() to fault in the pages
without actually writing to them, which would be destructive.

We'll use fault_in_iov_iter_writeable in gfs2 once we've determined that
the iterator passed to .read_iter isn't in memory.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/pagemap.h
include/linux/uio.h
lib/iov_iter.c
mm/gup.c