io_uring: correct pinned_vm accounting
authorPavel Begunkov <asml.silence@gmail.com>
Sun, 16 Oct 2022 22:31:25 +0000 (23:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 11:25:55 +0000 (13:25 +0200)
commit67cbc8865a66533fa08c1c13fe9acbaaae63c403
tree29980a4b69f6c2880e5dd640fce55b1e6f6da11a
parent904f881b57360cf85de962d84d8614d94431f60e
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