Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp898952ybl; Fri, 10 Jan 2020 08:33:23 -0800 (PST) X-Google-Smtp-Source: APXvYqy4Pd/HRdrD3EulrHKVxmZ6Vk7VLLw/9p88hLBqkP4jdc+Khm9v2D0YKoDZiVFpy0BRgjIO X-Received: by 2002:aca:1a17:: with SMTP id a23mr2709244oia.84.1578674003816; Fri, 10 Jan 2020 08:33:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578674003; cv=none; d=google.com; s=arc-20160816; b=gMCbpfW2xeFAjb89fYVUxdf6CZgW8THlAeXL/A1O2PlXJBOUWMriGWqZ/SgUPe4eZ3 wMpyH4tsJJiy8PT9ezLI4GG0aKA/W4HJ9c5KA5ZaYbEHxhvxui38teAO6gL9uP7imzpb +bpMNPLJcUKKxMhQi2MPEN+F/HPQ4umj9h/XeNGGi8O9LWcSbcQr02bchEPdJOxFpJqo ZDGmMyse+f7cnuBA42xeywk31osO+5hWM3PpjgT/9j/yuUbNuO/OHkpn3314IgUPZKGU aJSZ2D3x9lKNnfDIL/Q4iilQxZAB/+EI8g4yeXZQklrJofYWSbSLKYo0LkEUhGxzV9GB 8TcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4f3ZwVSD7Au+g+wQQaxZ1dIBB4xLFi6WJ1fku9tJ3ZM=; b=UV5eZIoEM3otaSeWKJZj/46BBTtSMxTM3oPPR493Gw7g3M1TfoklYy7x3M04IvU9SM RLWeOTo19IsFr7YOPDh0dQ62MntsNEGebddz1nAQ2XnXM/f7+JKbXE0BVh3x74RKh6Fx vGF1RR75k2YIOC65ph4zy3akedSvqZAP//WQrjwPfx8rV+zcVHAMp+blAoQpeUWSTEC5 epRA8ajSp7BRY8GAyEhBeE7oD2fKcr1Z6YRGWh9MbVjsTQE6LPC3sPQLV32bPyCxUKnq KygaZr6qzcebbH3/LquNWu+XPvXSDy2VHzEYL2np284cKjkzZcha0FXocNvifYzB+5BA R13Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IrbMpNEO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s18si1655083otr.172.2020.01.10.08.33.11; Fri, 10 Jan 2020 08:33:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IrbMpNEO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728838AbgAJQbn (ORCPT + 99 others); Fri, 10 Jan 2020 11:31:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:55804 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727928AbgAJQbn (ORCPT ); Fri, 10 Jan 2020 11:31:43 -0500 Received: from redsun51.ssa.fujisawa.hgst.com (unknown [199.255.47.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 65178205F4; Fri, 10 Jan 2020 16:31:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578673902; bh=Rrk4n1nHKqxj+BZCcSgnpXUKkWUtPTA1mv68Gy7dZO0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IrbMpNEO3empPNaJOZ9/BBjsosxffjbyeTmhwaC5ygwe1vlJhhVWfAh0XUUOmOySF nPLJuu4WDpKEvLXufBqY1wH+gLdayWRrZ2S6z2KwnwLWQ/Z/yLjN7KIp/aLEd+Sx26 dThCEIS9BeCJC1ZHLa2ixTdNyl1x5Tb/XyRM+3G0= Date: Sat, 11 Jan 2020 01:31:34 +0900 From: Keith Busch To: Amol Grover Cc: Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Joel Fernandes , Madhuparna Bhowmik , "Paul E . McKenney" Subject: Re: [PATCH] drivers: nvme: target: core: Pass lockdep expression to RCU lists Message-ID: <20200110163134.GA18579@redsun51.ssa.fujisawa.hgst.com> References: <20200110132356.27110-1-frextrite@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200110132356.27110-1-frextrite@gmail.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 10, 2020 at 06:53:58PM +0530, Amol Grover wrote: > +#define subsys_lock_held() \ > + lockdep_is_held(&subsys->lock) This macro requires "struct nvmet_subsys *subsys" was previously declared in the function using it, which isn't obvious when looking at the users. I don't think that's worth the conciseness. > @@ -555,7 +558,8 @@ int nvmet_ns_enable(struct nvmet_ns *ns) > } else { > struct nvmet_ns *old; > > - list_for_each_entry_rcu(old, &subsys->namespaces, dev_link) { > + list_for_each_entry_rcu(old, &subsys->namespaces, dev_link, > + subsys_lock_held()) { > BUG_ON(ns->nsid == old->nsid); > if (ns->nsid < old->nsid) > break;