From: Jens Axboe <axboe@xxxxxxxxx> commit ec858afda857e361182ceafc3d2ba2b164b8e889 upstream. This is a leftover from the really old days where we weren't able to track and error early if we need a file and it wasn't assigned. Kill the check. Cc: stable@xxxxxxxxxxxxxxx # v5.15+ Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/io_uring.c | 3 --- 1 file changed, 3 deletions(-) --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4128,9 +4128,6 @@ static int io_fsync_prep(struct io_kiocb { struct io_ring_ctx *ctx = req->ctx; - if (!req->file) - return -EBADF; - if (unlikely(ctx->flags & IORING_SETUP_IOPOLL)) return -EINVAL; if (unlikely(sqe->addr || sqe->ioprio || sqe->buf_index || Patches currently in stable-queue which might be from axboe@xxxxxxxxx are queue-5.15/nbd-add-error-handling-support-for-add_disk.patch queue-5.15/nbd-fix-possible-overflow-on-first_minor-in-nbd_dev_.patch queue-5.15/nbd-fix-hungtask-when-nbd_config_put.patch queue-5.15/io_uring-defer-splice-tee-file-validity-check-until-command-issue.patch queue-5.15/io_uring-don-t-touch-scm_fp_list-after-queueing-skb.patch queue-5.15/io_uring-nospec-index-for-tags-on-files-update.patch queue-5.15/io_uring-don-t-check-req-file-in-io_fsync_prep.patch queue-5.15/nbd-fix-incorrect-error-handle-when-first_minor-is-i.patch queue-5.15/drbd-fix-five-use-after-free-bugs-in-get_initial_sta.patch