[PATCH] afs: Fix possible infinite loop with unresponsive servers

Marc Dionne marc.dionne at auristor.com
Fri Sep 6 06:40:19 PDT 2024


A return code of 0 from afs_wait_for_one_fs_probe is an indication
that the endpoint state attached to the operation is stale and has
been superseded.  In that case the iteration needs to be restarted
so that the newer probe result state gets used.

Failure to do so can result in an tight infinite loop around the
iterate_address label, where all addresses are thought to be responsive
and have been tried, with nothing to refresh the enpoint state.

Fixes: 495f2ae9e355 ("afs: Fix fileserver rotation")
Link: https://lists.infradead.org/pipermail/linux-afs/2024-July/008628.html
Reported-by: Markus Suvanto <markus.suvanto at gmail.com>
cc: linux-afs at lists.infradead.org
Signed-off-by: Marc Dionne <marc.dionne at auristor.com>
---
 fs/afs/rotate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/afs/rotate.c b/fs/afs/rotate.c
index ed09d4d4c211..8bc285e87de7 100644
--- a/fs/afs/rotate.c
+++ b/fs/afs/rotate.c
@@ -633,7 +633,7 @@ bool afs_select_fileserver(struct afs_operation *op)
 	error = afs_wait_for_one_fs_probe(op->server, op->estate, op->addr_tried,
 					  !(op->flags & AFS_OPERATION_UNINTR));
 	if (!error)
-		goto iterate_address;
+		goto restart_from_beginning;
 
 	/* We've now had a failure to respond on all of a server's addresses -
 	 * immediately probe them again and consider retrying the server.
-- 
2.46.0




More information about the linux-afs mailing list