block: convert bio_map_user_iov to use iov_iter_extract_pages
authorDavid Howells <dhowells@redhat.com>
Sat, 21 Jan 2023 12:51:18 +0000 (13:51 +0100)
committerDavid Howells <dhowells@redhat.com>
Tue, 14 Feb 2023 17:09:41 +0000 (17:09 +0000)
commit07a646708a57a42b395bd2874862e613cec86fc0
tree51b1d3cd2a8d07e7a173cfe848c41fe9e4c0e9dc
parent6bc4b6f717933005d820535c51dab5250aa77eeb
block: convert bio_map_user_iov to use iov_iter_extract_pages

This will pin pages or leave them unaltered rather than getting a ref on
them as appropriate to the iterator.

The pages need to be pinned for DIO rather than having refs taken on them
to prevent VM copy-on-write from malfunctioning during a concurrent fork()
(the result of the I/O could otherwise end up being visible to/affected by
the child process).

Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
cc: Al Viro <viro@zeniv.linux.org.uk>
cc: Jens Axboe <axboe@kernel.dk>
cc: Jan Kara <jack@suse.cz>
cc: Matthew Wilcox <willy@infradead.org>
cc: Logan Gunthorpe <logang@deltatee.com>
cc: linux-block@vger.kernel.org
block/blk-map.c