block: Convert bio_iov_iter_get_pages to use iov_iter_extract_pages
authorDavid Howells <dhowells@redhat.com>
Mon, 22 May 2023 20:57:43 +0000 (21:57 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 24 May 2023 14:42:44 +0000 (08:42 -0600)
commita7e689dd1c06e0cbd6d216a6868e33099d8fc8d8
tree582ba605c80892a13c90d6ef1d372f71685b9b21
parentfd363244e883323e1ac9412d96fd22b51e255b0c
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
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230522205744.2825689-6-dhowells@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c