]> git.baikalelectronics.ru Git - kernel.git/commit
iov_iter: Four fixes for ITER_XARRAY
authorDavid Howells <dhowells@redhat.com>
Sun, 25 Apr 2021 21:02:38 +0000 (22:02 +0100)
committerDavid Howells <dhowells@redhat.com>
Mon, 26 Apr 2021 21:55:12 +0000 (22:55 +0100)
commit52504b2b8b67b2eb519dbdb669646a7f99765eee
treebb6b15242a45a6e6fc08d4e12fd469b0ee3f4565
parent1e6aaa949a6a3fda631f8f2b6e33c010ab397bd2
iov_iter: Four fixes for ITER_XARRAY

Fix four things[1] in the patch that adds ITER_XARRAY[2]:

 (1) Remove the address_space struct predeclaration.  This is a holdover
     from when it was ITER_MAPPING.

 (2) Fix _copy_mc_to_iter() so that the xarray segment updates count and
     iov_offset in the iterator before returning.

 (3) Fix iov_iter_alignment() to not loop in the xarray case.  Because the
     middle pages are all whole pages, only the end pages need be
     considered - and this can be reduced to just looking at the start
     position in the xarray and the iteration size.

 (4) Fix iov_iter_advance() to limit the size of the advance to no more
     than the remaining iteration size.

Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Jeff Layton <jlayton@redhat.com>
Tested-by: Dave Wysochanski <dwysocha@redhat.com>
Link: https://lore.kernel.org/r/YIVrJT8GwLI0Wlgx@zeniv-ca.linux.org.uk
Link: https://lore.kernel.org/r/161918448151.3145707.11541538916600921083.stgit@warthog.procyon.org.uk
include/linux/uio.h
lib/iov_iter.c