From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 97E6B466B74 for ; Tue, 16 Jun 2026 15:58:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781625506; cv=none; b=qc92sC3vz2drC44PZf6skRnTqJisogRjqtiPS4dpH1P5HotiRjCGLSvZaTc5Hjyqe8Fouwn6OKWjaMtvzN/mDkuOx4szLQkEaGdSy92TwyTpB7QLbuEih08xdmeSJRkL3pu4Qv2MvT6AF/xa/ug6Qipiz5e5oPIvtMIBfY5R1+w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781625506; c=relaxed/simple; bh=zReoDif8GIHIYA2Hu3YgKhY7lb4ZdfEXUjn0fON4DOE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kPyg6hTE6hoG5IGGh3e88eTNdnRK3uLqKMUDx8hdA+XEY2tshQOyOq3RWwx1Hf/MDznFhYzRvNw1i8GuT03v/SJZcGQgSACbo5Xa2tsM4KimcHuJaqu8RyJo4Lgc6mdeCf+YbZqiUSiyWw0uReYKDTk2e20z6kaiu4FQQvxNAIM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=MP132H1V; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="MP132H1V" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781625504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xg0b+LuRM8nTPjV/Ftm/dukTXV9BKAoWQPj8aMxMSko=; b=MP132H1Vm/fejGzTdjcpIwrX8pUWet8GQTsA7v+Wty0QbECx9a3fgtOIEfyWui/ECB68Pe RXkleH7PpSZfO8ntZyUZVYZqBQNbJFSacEQojm3LsFISH2kaSGzM3yiIR58zT5y8VeD16q gYZCQ/CORZTPA+ur0XYTaWREWg8b4T0= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-641-ywQM3Qp7N4CxrV9BWFueuw-1; Tue, 16 Jun 2026 11:58:21 -0400 X-MC-Unique: ywQM3Qp7N4CxrV9BWFueuw-1 X-Mimecast-MFC-AGG-ID: ywQM3Qp7N4CxrV9BWFueuw_1781625499 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1A7CA1956094; Tue, 16 Jun 2026 15:58:19 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.44.50.44]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DFAE9195419E; Tue, 16 Jun 2026 15:58:14 +0000 (UTC) From: David Howells To: netdev@vger.kernel.org Cc: David Howells , Marc Dionne , Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org, Li Daming , Ren Wei , Jeffrey Altman , stable@kernel.org Subject: [PATCH net 4/5] afs: Fix further netns teardown to cancel the preallocation charger Date: Tue, 16 Jun 2026 16:57:46 +0100 Message-ID: <20260616155749.2125907-5-dhowells@redhat.com> In-Reply-To: <20260616155749.2125907-1-dhowells@redhat.com> References: <20260616155749.2125907-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 When an afs network namespace is torn down, it cancels and waits for the work item that keeps the preallocated rxrpc call/conn/peer queue charged before disabling incoming (i.e. listen 0), but there's a small window in which it can be requeued by an incoming call wending through the I/O thread. Fix this by flushing the workqueue on which the charger runs after reducing the listen backlog to zero. Fixes: 47694fbc9d24 ("afs: Fix netns teardown to cancel the preallocation charger") Reported-by: Jakub Kicinski Signed-off-by: David Howells Link: https://sashiko.dev/#/patchset/20260609140911.838677-1-dhowells%40redhat.com cc: Li Daming cc: Ren Wei cc: Marc Dionne cc: Jeffrey Altman cc: Eric Dumazet cc: "David S. Miller" cc: Paolo Abeni cc: Simon Horman cc: linux-afs@lists.infradead.org cc: stable@kernel.org --- fs/afs/rxrpc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c index d5cfd24e815b..fd2d260fb25f 100644 --- a/fs/afs/rxrpc.c +++ b/fs/afs/rxrpc.c @@ -130,6 +130,7 @@ void afs_close_socket(struct afs_net *net) cancel_work_sync(&net->charge_preallocation_work); kernel_listen(net->socket, 0); flush_workqueue(afs_async_calls); + flush_workqueue(afs_wq); if (net->spare_incoming_call) { afs_put_call(net->spare_incoming_call);