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 A58D9231829; Tue, 21 Jul 2026 22:37:37 +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=1784673458; cv=none; b=dFEQxpda5//rtAShy+kWWgES0IxtvWNXp5usSEgRhESsAP+GgqJusJZkSPpgaPrscEpPu+USpGsYm71yQXl93jFAfKk9oco831c+a4kPNnk6G+pqKGpO25Ltneff9/AVOefcDPVdaSJnKX6jDt6IOP1Tff2oSwq7WpNHMpybbAk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784673458; c=relaxed/simple; bh=9vnXnEfk5Xsoc5+YDetGpM33a+5cvYtfL97Akdw9Gy4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QYHiPjUgxYUhUNkHOhCL0Bbn8YEjU8UhvJzfTKxYs6Wgw9ix5lfltErCMR5kgQJyz/12pRdEaDhXjDkIFA/D8k/TiZ6cWOGrte1PJjBujHiybbP7jj5aVfUBuVRH9Zkg3ndlX4sijSr1eKxx1LJa8o1yWcfQGQCIYKCHqf+NSaM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2OK8uuS5; 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="2OK8uuS5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CEEA1F000E9; Tue, 21 Jul 2026 22:37:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784673457; bh=A5YyHLS4ddKFeBC9yxGPZnia6lmsNPLNv+a4lm16lKM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=2OK8uuS51hjH97idh9ILWdoIHRY0RPx+9L3U86SxkT7NV5UnimJWe/NhBPhVnXNj+ 2J6jzkq8imxvTDZY9ubKl7uLYjhZNETV5yyvZNDgF1+6yMxKO3hrtc2isQScPyRrvo J3q308MOdd4kAIigMwCQIakr8iBnWGMiIUv0z93M= 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.10 168/699] afs: Fix further netns teardown to cancel the preallocation charger Date: Tue, 21 Jul 2026 17:18:47 +0200 Message-ID: <20260721152359.493673234@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152355.667394603@linuxfoundation.org> References: <20260721152355.667394603@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.10-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);