From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (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 96AA83A785D for ; Fri, 26 Jun 2026 06:40:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782456055; cv=none; b=dmbZ2ukfmKOOMlXk2qiHT3x+MazHJYjdDawXswj2OaKQlzgpJHPPD0ZMVKDpKRlnFDeOID4p0DuE47Gq3nma/VsgyAO4+yxvtNdFV2sGbHWlxLIUMo6XDT31CDfLVN6wj2ZRuJBM2Q2ANN5ln3vUtYO0pbzqbMj6Ru2fsBVmLJk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782456055; c=relaxed/simple; bh=RuRa3Mil5oL0/8+M7PyEmZL27nnrz0zTFxUpBcGkQs0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jqt+6vMF2xaH5YHHXkjqucbWjHqzDkTntjKYZGP3COOQYNcCw1AeVqYjhU1vhcJ3+ZhQ4I688HRn5VV7hXZOGOoZ37Y9wBW9AJjbzp3d9LNEZR3pBpa9pv9B2PmeF5qa5OTQzbN90c1J0Pu/2qVZSk+A5sLBW2MxUeA/AwlbVzE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id E087A68B05; Fri, 26 Jun 2026 08:40:50 +0200 (CEST) Date: Fri, 26 Jun 2026 08:40:50 +0200 From: Christoph Hellwig To: Nilay Shroff Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, kbusch@kernel.org, sagi@grimberg.me, axboe@fb.com, bvanassche@acm.org, elver@google.com, gjoyce@linux.ibm.com, "Paul E. McKenney" Subject: Re: [PATCHv2 05/17] nvme: add Clang context annotations for nvme_ns_head::current_path Message-ID: <20260626064050.GE10731@lst.de> References: <20260614131541.2017845-1-nilay@linux.ibm.com> <20260614131541.2017845-6-nilay@linux.ibm.com> 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-Disposition: inline In-Reply-To: <20260614131541.2017845-6-nilay@linux.ibm.com> User-Agent: Mutt/1.5.17 (2007-11-01) On Sun, Jun 14, 2026 at 06:45:20PM +0530, Nilay Shroff wrote: > +++ b/drivers/nvme/host/multipath.c > @@ -231,8 +231,16 @@ bool nvme_mpath_clear_current_path(struct nvme_ns *ns) > bool changed = false; > int node; > > + /* > + * This helper is used by namespace failover/teardown and I/O policy > + * update paths. We only compare the head->current_path[] pointer value > + * and do not dereference the referenced namespace, so suppress the > + * context analysis warning for this lockless inspection of the > + * __rcu_guarded pointer. > + */ > for_each_node(node) { > - if (ns == rcu_access_pointer(head->current_path[node])) { > + if (context_unsafe(ns == > + rcu_access_pointer(head->current_path[node]))) { I think we need a helper for this, as for a simple pointer value comparison without a dereference we don't really need either rcu_access_pointer nor locking. Maybe somthing like a rcu_compare_pointer(rcu_pointer, nonrcu_pointer) ?