]> 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)
commit3a93ea3b10623cda07d0017cf9d9388334a37461
treeca1295794fd2ddf0d8be6fdd83d5950bbfcf6b3c
parentb3dda6ddf55af06560bf16f77d7266256b8704a5
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