Skip to content

Commit

Permalink
io_uring: IORING_OP_WRITE needs hash_reg_file set
Browse files Browse the repository at this point in the history
commit 7b3188e upstream.

During some testing, it became evident that using IORING_OP_WRITE doesn't
hash buffered writes like the other writes commands do. That's simply
an oversight, and can cause performance regressions when doing buffered
writes with this command.

Correct that and add the flag, so that buffered writes are correctly
hashed when using the non-iovec based write command.

Cc: stable@vger.kernel.org
Fixes: 3a6820f ("io_uring: add non-vectored read/write commands")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
axboe authored and gregkh committed Sep 15, 2021
1 parent 656f343 commit 24fbd77
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/io_uring.c
Expand Up @@ -889,6 +889,7 @@ static const struct io_op_def io_op_defs[] = {
},
[IORING_OP_WRITE] = {
.needs_file = 1,
.hash_reg_file = 1,
.unbound_nonreg_file = 1,
.pollout = 1,
.async_size = sizeof(struct io_async_rw),
Expand Down

0 comments on commit 24fbd77

Please sign in to comment.