block: Convert bio_iov_iter_get_pages to use iov_iter_extract_pages
authorDavid Howells <dhowells@redhat.com>
Wed, 15 Mar 2023 16:35:48 +0000 (16:35 +0000)
committerJens Axboe <axboe@kernel.dk>
Wed, 15 Mar 2023 17:46:47 +0000 (11:46 -0600)
commit648627d7077d4de810e5f4c09490cb993514a53f
tree0f36f30b595cf3f64012be4e6a2eacb7b74377dd
parentb5596bf292996a5cd62f1fbc00c2c35f1a3faa12
block: Convert bio_iov_iter_get_pages 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 affected by/visible to 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
Link: https://lore.kernel.org/r/20230315163549.295454-2-dhowells@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c