]> git.baikalelectronics.ru Git - kernel.git/commit
iomap: Fix iomap_dio_rw return value for user copies
authorAndreas Gruenbacher <agruenba@redhat.com>
Thu, 14 Apr 2022 22:28:48 +0000 (06:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 May 2022 15:22:31 +0000 (17:22 +0200)
commitb56905763dc80f7866695ef14ce39eb19c2c6360
treecc0be822ad4801d38cac77b72b045142adf5afde
parenta030162964c4e4de39977afda44fa052437a589b
iomap: Fix iomap_dio_rw return value for user copies

commit debafb63ddb57d9359be52ac4337e66e464c6c41 upstream

When a user copy fails in one of the helpers of iomap_dio_rw, fail with
-EFAULT instead of returning 0.  This matches what iomap_dio_bio_actor
returns when it gets an -EFAULT from bio_iov_iter_get_pages.  With these
changes, iomap_dio_actor now consistently fails with -EFAULT when a user
page cannot be faulted in.

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