From nobody Fri Apr 3 11:10:07 2026 Received: from pdx-out-014.esa.us-west-2.outbound.mail-perimeter.amazon.com (pdx-out-014.esa.us-west-2.outbound.mail-perimeter.amazon.com [35.83.148.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 531DE28727E for ; Fri, 20 Feb 2026 17:10:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=35.83.148.184 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771607453; cv=none; b=kz6vscCbhaTLaLCh5PC3fsoIxFQgonwJpm1afRsNL63KnVXPLg4lI6ToabZxbZ9DVhaKMyhQEcWqJvMqQ5B4lZh6Huy8fyKwlvWN0rN6AOCSdcZo1cD5+f3U38pcJUPZ9WRjmLOMTK5RCREQtolVorX4eXW9+/2/RLHazOGL53A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771607453; c=relaxed/simple; bh=r9iCBw4beO70rUUdvap0m/q2XdAyI2hA2m+WIrFPJMQ=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=TjdQASYqx//RrRtKt5+XjXcCKgUTAr1Yg7+kvCQafyYBM2asmZS1ZUA2GdEgyr2v/r//5eRP9lzwwY0HB7TSSvPgNw7mEiHCN6CXpkbCYnTqWfFxQIczhb4wmmXPJwqT4/YGsB7Uei5Qers4LGnyl+TRnvMBn+YaM0L1/Wj+PjE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.com; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b=ADp8mNi5; arc=none smtp.client-ip=35.83.148.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b="ADp8mNi5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1771607452; x=1803143452; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=8VAeF4hiqnPoUmsSUO5Ei9ADs1HxAaCzQZriKr+o1go=; b=ADp8mNi5fLBogrkfUd40+1eObmETZj/ouD306U0m3aumYSvIsM9H/bzz gbIvIkI/EN972kkWbKH0WaaDgOSEOxEqttb9OikwXQMNMBxmEUtg0uVBW RXwNvaesTXvtNW4zUnvJlpplLapHSkbJOCrtcQjAAklK1Jfo5VTSLUWfS nC43Gqazv19Ove0BsAxC+4IYpd6/DZjb4qf5AlXznYNojqgmB/aYeCx2R cET0FJwUDfbKgM/mHzcdEsx3SJsDWPgyel2aD2kGizV2LoJFjPd6BVXnx mIP2VlJokSDwmQmE0K7/gTgbbAtHFV4zLafYTn96tyWWh5lMBoqmta5V2 w==; X-CSE-ConnectionGUID: rmJ57z85RQiJCQSvnTMzqg== X-CSE-MsgGUID: 7ovGhJXbQgKJfzx/1NmVyQ== X-IronPort-AV: E=Sophos;i="6.21,302,1763424000"; d="scan'208";a="13227706" Received: from ip-10-5-12-219.us-west-2.compute.internal (HELO smtpout.naws.us-west-2.prod.farcaster.email.amazon.dev) ([10.5.12.219]) by internal-pdx-out-014.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2026 17:10:49 +0000 Received: from EX19MTAUWC001.ant.amazon.com [205.251.233.105:31809] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.0.228:2525] with esmtp (Farcaster) id ec2ab470-5aa3-4d57-8db9-18b3d020794f; Fri, 20 Feb 2026 17:10:49 +0000 (UTC) X-Farcaster-Flow-ID: ec2ab470-5aa3-4d57-8db9-18b3d020794f Received: from EX19D001UWA001.ant.amazon.com (10.13.138.214) by EX19MTAUWC001.ant.amazon.com (10.250.64.174) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.35; Fri, 20 Feb 2026 17:10:48 +0000 Received: from c889f3b07a0a.amazon.com (10.106.83.29) by EX19D001UWA001.ant.amazon.com (10.13.138.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.37; Fri, 20 Feb 2026 17:10:47 +0000 From: Yuto Ohnuki To: David Howells , Marc Dionne CC: , , "Yuto Ohnuki" Subject: [PATCH] afs: check for duplicate servers in VL server list Date: Fri, 20 Feb 2026 17:10:37 +0000 Message-ID: <20260220171036.93539-2-ytohnuki@amazon.com> X-Mailer: git-send-email 2.50.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: EX19D046UWA003.ant.amazon.com (10.13.139.18) To EX19D001UWA001.ant.amazon.com (10.13.138.214) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The DNS response may contain the same server more than once. Check for duplicates by name and port before inserting into the list to avoid duplicate entries. Addresses the TODO comment in afs_extract_vlserver_list(). Signed-off-by: Yuto Ohnuki --- fs/afs/vl_list.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/fs/afs/vl_list.c b/fs/afs/vl_list.c index 9b1c20daac53..b2068af9531c 100644 --- a/fs/afs/vl_list.c +++ b/fs/afs/vl_list.c @@ -288,8 +288,20 @@ struct afs_vlserver_list *afs_extract_vlserver_list(st= ruct afs_cell *cell, afs_put_addrlist(old, afs_alist_trace_put_vlserver_old); } =20 + /* Check for duplicates in the server list */ + for (j =3D 0; j < vllist->nr_servers; j++) { + struct afs_vlserver *s =3D vllist->servers[j].server; =20 - /* TODO: Might want to check for duplicates */ + if (s->name_len =3D=3D server->name_len && + s->port =3D=3D server->port && + strncasecmp(s->name, server->name, server->name_len) =3D=3D 0) { + afs_put_vlserver(cell->net, server); + server =3D NULL; + break; + } + } + if (!server) + continue; =20 /* Insertion-sort by priority and weight */ for (j =3D 0; j < vllist->nr_servers; j++) { --=20 2.50.1 Amazon Web Services EMEA SARL, 38 avenue John F. Kennedy, L-1855 Luxembourg= , R.C.S. Luxembourg B186284 Amazon Web Services EMEA SARL, Irish Branch, One Burlington Plaza, Burlingt= on Road, Dublin 4, Ireland, branch registration number 908705