]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: account fixed file references correctly in batch
authorJens Axboe <axboe@kernel.dk>
Thu, 9 Jan 2020 14:52:28 +0000 (07:52 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 21 Jan 2020 00:04:06 +0000 (17:04 -0700)
commit16c341ba748b8b19ba176821cf25217b55509e43
treeca1295794fd2ddf0d8be6fdd83d5950bbfcf6b3c
parent940319035ab828fe42f97ae9870aae4b9e16f319
io_uring: account fixed file references correctly in batch

We can't assume that the whole batch has fixed files in it. If it's a
mix, or none at all, then we can end up doing a ref put that either
messes up accounting, or causes an oops if we have no fixed files at
all.

Also ensure we free requests properly between inflight accounted and
normal requests.

Fixes: 82c721577011 ("io_uring: extend batch freeing to cover more cases")
Reported-by: Dmitrii Dolgov <9erthalion6@gmail.com>
Reported-by: Pavel Begunkov <asml.silence@gmail.com>
Tested-by: Dmitrii Dolgov <9erthalion6@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c