]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
io_uring: IORING_OP_WRITE needs hash_reg_file set
authorJens Axboe <axboe@kernel.dk>
Tue, 31 Aug 2021 01:37:41 +0000 (19:37 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 08:00:56 +0000 (10:00 +0200)
commit 7b3188e7ed54102a5dcc73d07727f41fb528f7c8 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: 3a6820f2bb8a ("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>
fs/io_uring.c

index dff18be38c9c3e373da02b9658eeb6e133a02168..58ae2eab99efa2448cd5f1c668cd82f87819cffc 100644 (file)
@@ -990,6 +990,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,
                .plug                   = 1,