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.133.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 2325335A383 for ; Thu, 19 Mar 2026 17:04:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773939882; cv=none; b=qdcrrcXABtrQJTRAoNrnMYn3hku+Vn3nhDp4Kc6jqXWH2LvphM60i5CGl9MXBTxoaPQ2np8Au6QcGFyiTYGWbJNrLP32wix5V4Pehdo2LYknm8zNE0p8ZL/7bZBNG3DURdTCgsEz64tFVhlaeMlAgScjZmHLLLuommgYbwfuM08= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773939882; c=relaxed/simple; bh=03BSte5ur1ESQFztaQHD5S38FyMqv133fxP+/EoPyps=; h=From:In-Reply-To:References:To:Cc:Subject:MIME-Version: Content-Type:Date:Message-ID; b=JQHcnmXQlLUsp9qUxidUdLvEA82S8nPVjVBQjXA72QtJ/aya+t215qjgKgHpVOJYkdkrquF+Um2/5OPWjAlpcV22HuMm77XDSEJyVKKGGM+YcB3wyHMXAiHZtw2fayWFSccfVs3MhV39uPzo9JWg/z03SlNRkxraZ+iWsGIr5c4= 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=LUk8Dusi; arc=none smtp.client-ip=170.10.133.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="LUk8Dusi" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773939880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EsJ2OG69SbubXmt8lH1V5qQG/ZIrPbf/LE+6ud76W1c=; b=LUk8Dusi8C5fiY6sGwNsLCNLCWAW07trdV0yG+i5eS1iZi9iI5qxRwOv6Bdg1XSPQ+W4DU eKVfrfm/SgqlcTHUY0R7VOhsyjUIUWl0XN4Hzqqk4oo0zo6HMLU/PMWLdGsSUAwbb5cLHj r0/pQvBd+jizR8r5dN8T5N2OJ6I2gQ4= Received: from mx-prod-mc-03.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-630-5rwYHNayOBKTbmEOGOXuuw-1; Thu, 19 Mar 2026 13:04:36 -0400 X-MC-Unique: 5rwYHNayOBKTbmEOGOXuuw-1 X-Mimecast-MFC-AGG-ID: 5rwYHNayOBKTbmEOGOXuuw_1773939875 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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4FF761944F05; Thu, 19 Mar 2026 17:04:35 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.45.224.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0014E1955D84; Thu, 19 Mar 2026 17:04:33 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <971D421B-D22B-4C0F-AF6C-704CC95A9F02@objecting.org> References: <971D421B-D22B-4C0F-AF6C-704CC95A9F02@objecting.org> <20260318204515.26931-1-objecting@objecting.org> <4186139.1773929698@warthog.procyon.org.uk> To: Josh Law Cc: dhowells@redhat.com, Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] lib/assoc_array: fix stale nr_leaves_on_tree after gc Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <173098.1773939872.1@warthog.procyon.org.uk> Date: Thu, 19 Mar 2026 17:04:32 +0000 Message-ID: <173099.1773939872@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Josh Law wrote: > Well, the bug actually is there, But is there a bug? The field is internal to assoc_array, and the assoc_array code only accesses it if the caller is holding a lock to prevent other modifications. The field is not pertinent to searching the tree under just the RCU read lock. > and if i made a mistake, this patch should atleast be hardening level, (As i > say, better safe than sorry) Your patch doesn't actually fix the issue; it merely slides the window. The window *could* be closed on x86_64, say, by using CMPXCHG16 to change both the root pointer and the counter simultaneously, but beyond that you can't close it without using a lock. David