Re: "netfs: Can't donate prior to front"

David Howells
2025-02-10T14:08:02Z

Can you apply the attached patch to your kernel, and then run with:

echo 1 >/sys/kernel/debug/tracing/events/netfs/netfs_read/enable
echo 1 >/sys/kernel/debug/tracing/events/netfs/netfs_rreq/enable
echo 1 >/sys/kernel/debug/tracing/events/netfs/netfs_sreq/enable
echo 1 >/sys/kernel/debug/tracing/events/netfs/netfs_failure/enable
echo 1 >/sys/kernel/debug/tracing/events/netfs/netfs_donate/enable
echo 1 >/sys/kernel/debug/tracing/events/netfs/netfs_progress/enable

enabled. If you can capture the trace output (and compress it!), that should
hopefully help debug this.

David

diff --git a/fs/netfs/read_collect.c b/fs/netfs/read_collect.c
index e8624f5c7fcc..8b78c1ec0677 100644
--- a/fs/netfs/read_collect.c
+++ b/fs/netfs/read_collect.c
@@ -312,6 +312,7 @@ static bool netfs_consume_read_data(struct netfs_io_subrequest *subreq, bool was
printk("folio: %llx-%llx\n", fpos, fend - 1);
printk("donated: prev=%zx next=%zx\n", prev_donated, next_donated);
printk("s=%llx av=%zx part=%zx\n", start, avail, part);
+ tracing_off();
BUG();
}