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

Jeffrey E Altman jaltman at auristor.com
Fri Sep 6 07:18:11 PDT 2024


On 9/6/2024 9:40 AM, Marc Dionne wrote:
> 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.

Reviewed-by: Jeffrey Altman <jaltman at auristor.com>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4276 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.infradead.org/pipermail/linux-afs/attachments/20240906/34217fbf/attachment.p7s>


More information about the linux-afs mailing list