lkml.org 
[lkml]   [2020]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] drivers: nvme: target: core: Pass lockdep expression to RCU lists
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;

\
 
 \ /
  Last update: 2020-01-10 18:11    [W:0.043 / U:1.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site