]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
io_uring: make fallocate be hashed work
authorFengnan Chang <changfengnan@bytedance.com>
Mon, 23 Jun 2025 11:02:18 +0000 (19:02 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jul 2025 16:35:20 +0000 (18:35 +0200)
[ Upstream commit 88a80066af1617fab444776135d840467414beb6 ]

Like ftruncate and write, fallocate operations on the same file cannot
be executed in parallel, so it is better to make fallocate be hashed
work.

Signed-off-by: Fengnan Chang <changfengnan@bytedance.com>
Link: https://lore.kernel.org/r/20250623110218.61490-1-changfengnan@bytedance.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
io_uring/opdef.c

index 3b9c6489b8b6d2732b1e349b1184a09a367c9f8b..2d0a7db940fdb0cd30a31f9c1e7dd2041b0373b0 100644 (file)
@@ -202,6 +202,7 @@ const struct io_issue_def io_issue_defs[] = {
        },
        [IORING_OP_FALLOCATE] = {
                .needs_file             = 1,
+               .hash_reg_file          = 1,
                .prep                   = io_fallocate_prep,
                .issue                  = io_fallocate,
        },