io_uring: correct pinned_vm accounting
authorPavel Begunkov <asml.silence@gmail.com>
Sun, 16 Oct 2022 21:42:55 +0000 (22:42 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:35:52 +0000 (12:35 +0200)
commitcd148d4e3183d982e2c624a1cd88512ccab0b2ed
treefce45e8654a1d71781ca1e1fe4039c81c5217200
parent813d8fe5d30388f73a21d3a2bf46b0a1fd72498c
io_uring: correct pinned_vm accounting

[ upstream commit 42b6419d0aba47c5d8644cdc0b68502254671de5 ]

->mm_account should be released only after we free all registered
buffers, otherwise __io_sqe_buffers_unregister() will see a NULL
->mm_account and skip locked_vm accounting.

Cc: <Stable@vger.kernel.org>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/6d798f65ed4ab8db3664c4d3397d4af16ca98846.1664849932.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/io_uring.c