diff options
author | 2025-07-01 17:38:39 +0100 | |
---|---|---|
committer | 2025-07-01 22:37:13 +0200 | |
commit | 09623e3a14c1c5465124350cd227457c2b0fb017 (patch) | |
tree | c401f85afa90bcc73f672c6fbf3a1c8b00b3bcfb /tools/perf/scripts/python | |
parent | netfs: Provide helpers to perform NETFS_RREQ_IN_PROGRESS flag wangling (diff) | |
download | wireguard-linux-09623e3a14c1c5465124350cd227457c2b0fb017.tar.xz wireguard-linux-09623e3a14c1c5465124350cd227457c2b0fb017.zip |
netfs: Fix looping in wait functions
netfs_wait_for_request() and netfs_wait_for_pause() can loop forever if
netfs_collect_in_app() returns 2, indicating that it wants to repeat
because the ALL_QUEUED flag isn't yet set and there are no subreqs left
that haven't been collected.
The problem is that, unless collection is offloaded (OFFLOAD_COLLECTION),
we have to return to the application thread to continue and eventually set
ALL_QUEUED after pausing to deal with a retry - but we never get there.
Fix this by inserting checks for the IN_PROGRESS and PAUSE flags as
appropriate before cycling round - and add cond_resched() for good measure.
Fixes: 2b1424cd131c ("netfs: Fix wait/wake to be consistent about the waitqueue used")
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/20250701163852.2171681-5-dhowells@redhat.com
Tested-by: Steve French <sfrench@samba.org>
Reviewed-by: Paulo Alcantara <pc@manguebit.org>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions