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 E86813D79FE for ; Thu, 18 Jun 2026 07:49:54 +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=1781768996; cv=none; b=DE3gNC1amf6E0MCqiQpZKhyEGkv2qZvjWgmyLD3YekoiZ2F7mSQ3OgNJ6b2fOZT6xU9pES5yjyRZw4om+8WwaZPEiMU/0oqgH1LL0zUXOUniBRm6EniT3wl4BzpyCgcbY3/Ne4JqtdniH0DUgHYEPfGBje/sVwzlT9CIFI9o+kI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781768996; c=relaxed/simple; bh=/fsjfjNKtSfO4Vam4ufvsdasBcCg/2mdCnyqyUq+WvA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MYj47YcTE8tC+0HtsNbIldDN/wy37OZ/xzkU7V7pjBTtG156X36V4DVOQ3MnNm1QbpqdMeHCMsunyHYDVtDsSCe94JDqf9+X3i0Rs9ILrhoEgoap+ew2cJB+f1drnN/Yj39mwqLTYKO7R0CwkmqVp4WiGdCgsbPnrYIssd77F+s= 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=NxdA7F+G; 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="NxdA7F+G" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781768993; 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=CxsEpgmRoMeDmx5HmC7wIc5r2HzgDTOugg9rSTYQcLY=; b=NxdA7F+GOtcTc91fY0QaWlA39B3nLdfsyIOiVk/FCE2ZZKwaAsoco3dU3T2rBaRdyrC+Xt N3/x9K22R5N1xpYBpFv7iN4uThen8vc4IEI0wL9KYNDgVu3MeFr+UZ1S1MOp7nxJh5b52h a06h3kgpypnYkgCgIGVsMMq64hNj9Ds= 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-141-JyZr0o8vNHSm85m6D5mSNQ-1; Thu, 18 Jun 2026 03:49:50 -0400 X-MC-Unique: JyZr0o8vNHSm85m6D5mSNQ-1 X-Mimecast-MFC-AGG-ID: JyZr0o8vNHSm85m6D5mSNQ_1781768988 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 719AA1956051; Thu, 18 Jun 2026 07:49:48 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.44.50.44]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1911130000DB; Thu, 18 Jun 2026 07:49:45 +0000 (UTC) From: David Howells To: Christian Brauner Cc: David Howells , Marc Dionne , linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Hillf Danton Subject: [PATCH v2 09/17] afs: Fix misplaced inc of net->cells_outstanding Date: Thu, 18 Jun 2026 08:48:52 +0100 Message-ID: <20260618074903.2374756-10-dhowells@redhat.com> In-Reply-To: <20260618074903.2374756-1-dhowells@redhat.com> References: <20260618074903.2374756-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Fix net->cells_outstanding being incremented before the check for failure of idr_alloc_cyclic(), leaving the count incremented on error. Fixes: 88c853c3f5c0 ("afs: Fix cell refcounting by splitting the usage counter") Reported-by: Hillf Danton Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org --- fs/afs/cell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/afs/cell.c b/fs/afs/cell.c index 9738684dbdd2..e0fab1609f27 100644 --- a/fs/afs/cell.c +++ b/fs/afs/cell.c @@ -205,11 +205,11 @@ static struct afs_cell *afs_alloc_cell(struct afs_net *net, cell->dns_source = vllist->source; cell->dns_status = vllist->status; smp_store_release(&cell->dns_lookup_count, 1); /* vs source/status */ - atomic_inc(&net->cells_outstanding); ret = idr_alloc_cyclic(&net->cells_dyn_ino, cell, 2, INT_MAX / 2, GFP_KERNEL); if (ret < 0) goto error; + atomic_inc(&net->cells_outstanding); cell->dynroot_ino = ret; cell->debug_id = atomic_inc_return(&cell_debug_id);