From: Jens Axboe Date: Wed, 30 Mar 2022 17:06:02 +0000 (-0600) Subject: io_uring: don't check req->file in io_fsync_prep() X-Git-Tag: baikal/mips/sdk6.1~6011^2~12 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=d255b16c2b625e3d93319a372d49d6c91eaaaf7d;p=kernel.git io_uring: don't check req->file in io_fsync_prep() 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@vger.kernel.org # v5.15+ Signed-off-by: Jens Axboe --- diff --git a/fs/io_uring.c b/fs/io_uring.c index a8413f0064170..9108c56bff5b9 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4513,9 +4513,6 @@ static int io_fsync_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) { 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 ||