From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 0C16144AB62; Tue, 21 Jul 2026 22:02:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784671362; cv=none; b=Kw3y6jted584y+WyEFmRwveZQSwsOp4I7ZgSmKgTDTwR5w9790PI7QkixSIfb1nGlEY6QSSiPRIP6wdK1ELQbofUion0/KhEaK8QsIHPlvaacH0h022MxUjLbgWv5Bvl3if1sUM45evFtTDKYXq8KSaw/Nn8TOiZQfNBQqMsy4s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784671362; c=relaxed/simple; bh=1lxmU9i/YwYEcyrEvv1ZlI2uNI4aVp3Sn4c5LMj8dYI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DMEP66Ei3m5Jb576FRkUVGK8+zQ+38z6mMbytOAfziwGJHz/Aj2T8J0fxOk9hfUuh/4Szqjnf8u6xKrJE6TbnBV2nbYY+t7413S1fhRnGBhlEHAXNLQ4tvoEN4a++BdPpSnAmvcnGaWfEVnkzIMFrh88b1GmHPAvIST8y9XjAeQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=xf+2EK4y; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="xf+2EK4y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78C501F000E9; Tue, 21 Jul 2026 22:02:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784671360; bh=1spQpjayuRXcTJF6I5lPdq0MsPJxpoiuRJDQwmNIAhQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=xf+2EK4yT5+x/tU6F9tfEAnElJwtzOy+44i4hbPdXADHu0VBSuFBVwEt6DoOjg7wp OBTqWZBA5GGz2PFco83PpXO6JffKT8W3mcOVrYdfPMP2JtDnwx8vdw6E3Jb4iIC+5b Qxlb+f8fdlHCybPouv9mhg1iGlY4sSv+NpL3JBMw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jakub Kicinski , David Howells , Li Daming , Ren Wei , Marc Dionne , Jeffrey Altman , Simon Horman , linux-afs@lists.infradead.org, stable@kernel.org Subject: [PATCH 5.15 215/843] afs: Fix further netns teardown to cancel the preallocation charger Date: Tue, 21 Jul 2026 17:17:30 +0200 Message-ID: <20260721152410.852600414@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152405.946368001@linuxfoundation.org> References: <20260721152405.946368001@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Howells commit 2daf8ac812c3d78c642fe7652f62e29df5e3da20 upstream. 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 cancelling the charger work item again 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: Simon Horman cc: linux-afs@lists.infradead.org cc: stable@kernel.org Link: https://patch.msgid.link/20260624163819.3017002-5-dhowells@redhat.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- fs/afs/rxrpc.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/fs/afs/rxrpc.c +++ b/fs/afs/rxrpc.c @@ -108,8 +108,13 @@ void afs_close_socket(struct afs_net *ne _enter(""); cancel_work_sync(&net->charge_preallocation_work); + /* Future work items should now see ->live is false. */ + kernel_listen(net->socket, 0); + + /* Make sure work items are no longer running. */ flush_workqueue(afs_async_calls); + cancel_work_sync(&net->charge_preallocation_work); if (net->spare_incoming_call) { afs_put_call(net->spare_incoming_call);