Skip to content

Commit

Permalink
io_uring: don't repeat valid flag list
Browse files Browse the repository at this point in the history
req->flags stores all sqe->flags. After checking that sqe->flags are
valid set if IOSQE* flags, no need to double check it, just forward them
all.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Pavel Begunkov authored and Jens Axboe committed May 17, 2020
1 parent 9f13c35 commit c11368a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -5915,9 +5915,7 @@ static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req,
}

/* same numerical values with corresponding REQ_F_*, safe to copy */
req->flags |= sqe_flags & (IOSQE_IO_DRAIN | IOSQE_IO_HARDLINK |
IOSQE_ASYNC | IOSQE_FIXED_FILE |
IOSQE_BUFFER_SELECT | IOSQE_IO_LINK);
req->flags |= sqe_flags;

if (!io_op_defs[req->opcode].needs_file)
return 0;
Expand Down

0 comments on commit c11368a

Please sign in to comment.