]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: prune request from overflow list on flush
authorJens Axboe <axboe@kernel.dk>
Fri, 14 Feb 2020 00:17:35 +0000 (17:17 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 14 Feb 2020 00:25:01 +0000 (17:25 -0700)
commit05d0b2140c3160bedfe8e97c16df6b86a07cac27
treeb5ae170bdb1e323aa80bfed7e77f4c4efb48d12d
parent8651420dd1d2b09307feacc3b378c3e5e96e69e0
io_uring: prune request from overflow list on flush

Carter reported an issue where he could produce a stall on ring exit,
when we're cleaning up requests that match the given file table. For
this particular test case, a combination of a few things caused the
issue:

- The cq ring was overflown
- The request being canceled was in the overflow list

The combination of the above means that the cq overflow list holds a
reference to the request. The request is canceled correctly, but since
the overflow list holds a reference to it, the final put won't happen.
Since the final put doesn't happen, the request remains in the inflight.
Hence we never finish the cancelation flush.

Fix this by removing requests from the overflow list if we're canceling
them.

Cc: stable@vger.kernel.org # 5.5
Reported-by: Carter Li 李通洲 <carter.li@eoitek.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c