io_uring: drop the old style inflight file tracking for-5.18/io_uring
authorJens Axboe <axboe@kernel.dk>
Thu, 31 Mar 2022 18:38:46 +0000 (12:38 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 1 Apr 2022 15:02:32 +0000 (09:02 -0600)
commitf5e6d9c5b08bc26e8d49fae34635b4115f8bcacb
treea413acd4a9b104f60e2ba5c68324dbe84e76a944
parentb4f73ede83dabfd49d925846bf7658ecf3a2986a
io_uring: drop the old style inflight file tracking

io_uring tracks requests that are referencing an io_uring descriptor to
be able to cancel without worrying about loops in the references. Since
we now assign the file at execution time, the easier approach is to drop
a potentially problematic reference before we punt the request. This
eliminates the need to special case these types of files beyond just
marking them as such, and simplifies cancelation quite a bit.

This also fixes a recent issue where an async punted tee operation would
with the io_uring descriptor as the output file would crash when
attempting to get a reference to the file from the io-wq worker. We
could have worked around that, but this is the much cleaner fix.

Fixes: 734a69489dd7 ("io_uring: defer file assignment")
Reported-by: syzbot+c4b9303500a21750b250@syzkaller.appspotmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c