iomap: Support partial direct I/O on user copy failures
authorAndreas Gruenbacher <agruenba@redhat.com>
Thu, 14 Apr 2022 22:28:49 +0000 (06:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 May 2022 15:22:31 +0000 (17:22 +0200)
commitea7a57858875256e233d29b9c01b9f558f3bd12a
treee839ffafa56e2f8b61e10c7a56fa0c265fe57faf
parenta00cc46f97b9b9544c5edabc81d6cbfadd0ffdab
iomap: Support partial direct I/O on user copy failures

commit 97308f8b0d867e9ef59528cd97f0db55ffdf5651 upstream

In iomap_dio_rw, when iomap_apply returns an -EFAULT error and the
IOMAP_DIO_PARTIAL flag is set, complete the request synchronously and
return a partial result.  This allows the caller to deal with the page
fault and retry the remainder of the request.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/iomap/direct-io.c
include/linux/iomap.h