diff options
| author | Cheng Yongkang <teel4res@gmail.com> | 2026-11-15 20:45:31 -0800 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2026-11-16 19:48:35 -0700 |
| commit | e5a346e4309d720c47fe8331a00068608fad47dd (patch) | |
| tree | 4d1600a3b9c95a5d43daef0a2e3d96d4e9f2493d /kernel/debug | |
| parent | 97d4a585db2b91d855f957be0a9f126068c5be93 (diff) | |
io_uring/rsrc: keep the old file when a file update fails
__io_sqe_files_update() resets the slot before it calls fget() on the
new fd. If fget() fails, the fd is an io_uring file, or the node
allocation fails, the update stops and reports that entry as not done,
but the old file has already been removed. Later requests that use the
slot fail with -EBADF, and if the old file was registered with a tag,
its tag CQE is posted as if it had been removed on purpose.
Reset the slot only after the new file has been checked and its node
allocated, as io_install_fixed_file() does. Removal with fd == -1 still
resets the slot right away.
Fixes: c3a31e605620 ("io_uring: add support for IORING_REGISTER_FILES_UPDATE")
Cc: stable@vger.kernel.org
Signed-off-by: Cheng Yongkang <teel4res@gmail.com>
Link: https://patch.msgid.link/20261116044531.281978-1-teel4res@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'kernel/debug')
0 files changed, 0 insertions, 0 deletions
