]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.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)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 15 Oct 2021 09:27:34 +0000 (11:27 +0200)
BugLink: https://bugs.launchpad.net/bugs/1946788
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
fs/io_uring.c

index d24eb8e53c4cd978c92a3655711bd71448f51911..c8fe15a5f60df21f2a8fb37629fe04be2bbfa50c 100644 (file)
@@ -928,6 +928,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,