Skip to content

Commit 4c238e3

Browse files
dhowellsbrauner
authored andcommitted
netfs: Fix copy-to-cache so that it performs collection with ceph+fscache
The netfs copy-to-cache that is used by Ceph with local caching sets up a new request to write data just read to the cache. The request is started and then left to look after itself whilst the app continues. The request gets notified by the backing fs upon completion of the async DIO write, but then tries to wake up the app because NETFS_RREQ_OFFLOAD_COLLECTION isn't set - but the app isn't waiting there, and so the request just hangs. Fix this by setting NETFS_RREQ_OFFLOAD_COLLECTION which causes the notification from the backing filesystem to put the collection onto a work queue instead. Fixes: e2d46f2 ("netfs: Change the read result collector to only use one work item") Reported-by: Max Kellermann <[email protected]> Link: https://lore.kernel.org/r/CAKPOu+8z_ijTLHdiCYGU_Uk7yYD=shxyGLwfe-L7AV3DhebS3w@mail.gmail.com/ Signed-off-by: David Howells <[email protected]> Link: https://lore.kernel.org/[email protected] Reviewed-by: Paulo Alcantara (Red Hat) <[email protected]> cc: Paulo Alcantara <[email protected]> cc: Viacheslav Dubeyko <[email protected]> cc: Alex Markuze <[email protected]> cc: Ilya Dryomov <[email protected]> cc: [email protected] cc: [email protected] cc: [email protected] cc: [email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent fdfe013 commit 4c238e3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/netfs/read_pgpriv2.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ static struct netfs_io_request *netfs_pgpriv2_begin_copy_to_cache(
110110
if (!creq->io_streams[1].avail)
111111
goto cancel_put;
112112

113+
__set_bit(NETFS_RREQ_OFFLOAD_COLLECTION, &creq->flags);
113114
trace_netfs_write(creq, netfs_write_trace_copy_to_cache);
114115
netfs_stat(&netfs_n_wh_copy_to_cache);
115116
rreq->copy_to_cache = creq;

0 commit comments

Comments
 (0)