Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp937432ybl; Fri, 10 Jan 2020 09:11:58 -0800 (PST) X-Google-Smtp-Source: APXvYqyFv0kDdNXkjSk5+IzqvO3OBKSUmFp6ZkZw2L2u1QTHFi7e3Tp0PFIrFHKeLvdx24wK4Y3z X-Received: by 2002:a9d:6859:: with SMTP id c25mr3369935oto.205.1578676318169; Fri, 10 Jan 2020 09:11:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578676318; cv=none; d=google.com; s=arc-20160816; b=r6VtJDOeZOIuuIsZnNFa2VEwj0s/HFiNv0sit537celEp51p4IVeKxQRBa1rJy+e70 hs2dLYYqIncPs0FPL5xdJaoXBUFFVzBFX9NdmNPauH4KgFjhcfVEWsOwl0kE0cpy0VOh uIkTMyjmTclr3ROXn4sj4YxmsWs//p/O+0Uq1bW5A6OhGvMhlCHtCgcSAP5C6yUDRD6H 8Wna/VTKbhDxFkq/3GI3FkRlSB4N2F1tnU6dharyjTdWrSPMHOaINpOS9AO/baXpwuRO jc1E7bPLY/s1ggQ5xj5IAY7zxu2PkZQesrChy7MSnsbhFxuuvwUyvjGhI1U0h+ZD1z5k EV/A== 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=iBvXLyc1YHRba12d1qGOEAYppdC7uysd/CuW1Cdr6XE=; b=W85A3qc4SoR349OT9fL2SrIaH6RP1HPj7J5oc8ulzw60IZMfSYdjMpusaMChT/01ez 4X73kK5g1z2cUBazVTH4pcr31sPBMQF4n1jZICP707ilzmYlw5DU5H5fN41s5lnTXRMh gUbZ4fmoI/St2+gvMoexZhzWRBOsbsTMYOpef47HVmCi+Kg07g3/LkUQDqJ3Fczj58+j Pl9EIyZxwWgYNfSm9ewvuOJsaiCJj9ohsz9Dr43eLG237y6DEnIdziX0ZIYP0oEcpcH6 upfcMrj1cwBwmwQHmYn7yE5M+r+MuGhAQ+uQwsOpEtK4KcGo+0v9VGGV0jqBR17C0xbR O7bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JB4sy+pm; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l6si1690138oti.249.2020.01.10.09.11.45; Fri, 10 Jan 2020 09:11:58 -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=@gmail.com header.s=20161025 header.b=JB4sy+pm; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726482AbgAJRKk (ORCPT + 99 others); Fri, 10 Jan 2020 12:10:40 -0500 Received: from mail-pj1-f65.google.com ([209.85.216.65]:54027 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725774AbgAJRKk (ORCPT ); Fri, 10 Jan 2020 12:10:40 -0500 Received: by mail-pj1-f65.google.com with SMTP id n96so1215569pjc.3 for ; Fri, 10 Jan 2020 09:10:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=iBvXLyc1YHRba12d1qGOEAYppdC7uysd/CuW1Cdr6XE=; b=JB4sy+pmPxNmEF/IdqEUR4mvTdV9p7qM1GbSFbiOx+lPHtjw21+yh3LyCdNHutFle3 oNfFdIM17nKtIUnrPFaH30yfEcIU8rZIxG+HQ/vIxaCBN9wccSmvvDjNUkHOzHW74bbK UbDCOFCQcWSEKDM+Zfh8d1OybJn/+DtMAe76/m2XcfjrnXJa4sOR5YPNIONcQNZT/dTM wI+E5MsdSSnOUcoVfETiO13aGp/6LYAQx60L27zX4xESNKkyJRm20JTK7go67aubHdrc j6yr4ScXzkAXLzEQCLMbRyONEGuwDDMMU7b4Pgz/I0GXhHeDS2+x1jrT8egiJhG1Y1+k COVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=iBvXLyc1YHRba12d1qGOEAYppdC7uysd/CuW1Cdr6XE=; b=ndsMcwwRwQE4WgFGmhQ1B0ImGVuRBEmpJodqyrYA7ecTRtOQbV61Pfb6xM6wsIBVgz WoMkDzToYHrqHyLrBNV1Nb2Qspg5W45XEdQiockg0q68XSdGIcl9WJoSSE8IzWFCytQn jhDju4HQ4gMgagy1nDCxIBGrbRDB+rew7fxCIL71Ba1nZrBR/WCmr+ClsLVDE/2PCLg6 guw/jJE2tABJrcUGWZueAOZarOto51hEOClnfgg6PpsFJCvAaN4vHqeLuVEUegAiWEmh fYpmxIZiJFn6ow3DFgemnICBCWswAp1LIWl5KdSg2x8YZpC3xprbCGeWj6/HTi6NDb4z tWPg== X-Gm-Message-State: APjAAAWdCJAEFM0s9HvVNnXACuImU8QOd9wbAlD1BsVM7HI/Epu8Gxje jJ9hTTlk182zIixBEneVYuc= X-Received: by 2002:a17:90a:c583:: with SMTP id l3mr6263355pjt.58.1578676239815; Fri, 10 Jan 2020 09:10:39 -0800 (PST) Received: from workstation-kernel-dev ([103.211.17.220]) by smtp.gmail.com with ESMTPSA id b8sm3730301pfr.64.2020.01.10.09.10.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2020 09:10:39 -0800 (PST) Date: Fri, 10 Jan 2020 22:40:33 +0530 From: Amol Grover To: Keith Busch 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: <20200110171033.GA23748@workstation-kernel-dev> References: <20200110132356.27110-1-frextrite@gmail.com> <20200110163134.GA18579@redsun51.ssa.fujisawa.hgst.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200110163134.GA18579@redsun51.ssa.fujisawa.hgst.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 11, 2020 at 01:31:34AM +0900, Keith Busch wrote: > 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. > Hey Keith, If I understand correctly, you're saying `*subsys` is always declared in the function using it, right? I too think, this could cause confusion to the person going through the code, I'll fix it right away. Thanks Amol > > @@ -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;