From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C659EC282DD for ; Fri, 10 Jan 2020 16:31:46 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8EEB22084D for ; Fri, 10 Jan 2020 16:31:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="IrbMpNEO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8EEB22084D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-kernel-mentees-bounces@lists.linuxfoundation.org Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 5CD69204DA; Fri, 10 Jan 2020 16:31:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xnpn9TWmh9y6; Fri, 10 Jan 2020 16:31:44 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 7F10420353; Fri, 10 Jan 2020 16:31:44 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6711FC1796; Fri, 10 Jan 2020 16:31:44 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 99EE7C0881 for ; Fri, 10 Jan 2020 16:31:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 87866869C7 for ; Fri, 10 Jan 2020 16:31:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o4Idi42MYxbH for ; Fri, 10 Jan 2020 16:31:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by whitealder.osuosl.org (Postfix) with ESMTPS id 10189869B4 for ; Fri, 10 Jan 2020 16:31:43 +0000 (UTC) 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 Message-ID: <20200110163134.GA18579@redsun51.ssa.fujisawa.hgst.com> References: <20200110132356.27110-1-frextrite@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200110132356.27110-1-frextrite@gmail.com> User-Agent: Mutt/1.12.1 (2019-06-15) Cc: Sagi Grimberg , Chaitanya Kulkarni , "Paul E . McKenney" , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, Joel Fernandes , linux-kernel-mentees@lists.linuxfoundation.org, Christoph Hellwig Subject: Re: [Linux-kernel-mentees] [PATCH] drivers: nvme: target: core: Pass lockdep expression to RCU lists X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" 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; _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees