]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
netfs: Fix writethrough to use collection offload
authorDavid Howells <dhowells@redhat.com>
Thu, 25 Jun 2026 14:06:30 +0000 (15:06 +0100)
committerChristian Brauner <brauner@kernel.org>
Wed, 1 Jul 2026 13:26:30 +0000 (15:26 +0200)
Fix writethrough write to set NETFS_RREQ_OFFLOAD_COLLECTION on the request
so that collection is processed asynchronously rather than only right at
the end - and also so that asynchronous O_SYNC writes get collected at all.

Fixes: 288ace2f57c9 ("netfs: New writeback implementation")
Closes: https://sashiko.dev/#/patchset/20260616100821.2062304-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://patch.msgid.link/20260625140640.3116900-13-dhowells@redhat.com
cc: Paulo Alcantara <pc@manguebit.org>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/netfs/write_issue.c

index 2473bce37649fa02ecf1e9b744a986bb6d989d13..3b363ce12f3f73efda42ac909390f0e679c10b82 100644 (file)
@@ -620,6 +620,7 @@ struct netfs_io_request *netfs_begin_writethrough(struct kiocb *iocb, size_t len
        }
 
        wreq->io_streams[0].avail = true;
+       __set_bit(NETFS_RREQ_OFFLOAD_COLLECTION, &wreq->flags);
        trace_netfs_write(wreq, netfs_write_trace_writethrough);
        return wreq;
 }