diff mbox

[v3,1/5] kobject: Export kobj_ns_grab_current() and kobj_ns_drop()

Message ID 20180108231436.19750-2-bart.vanassche@wdc.com (mailing list archive)
State Superseded
Delegated to: Doug Ledford
Headers show

Commit Message

Bart Van Assche Jan. 8, 2018, 11:14 p.m. UTC
Make it possible to call these two functions from a kernel module.
Note: despite their name, these two functions can be used meaningfully
independent of kobjects. A later patch will add calls to these
functions from the SRP driver because this patch series modifies the
SRP driver such that it can hold a reference to a namespace that can
last longer than the lifetime of the process through which the
namespace reference was obtained.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 lib/kobject.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Bart Van Assche Jan. 9, 2018, 5:59 p.m. UTC | #1
On Mon, 2018-01-08 at 15:14 -0800, Bart Van Assche wrote:
> Make it possible to call these two functions from a kernel module.

> Note: despite their name, these two functions can be used meaningfully

> independent of kobjects. A later patch will add calls to these

> functions from the SRP driver because this patch series modifies the

> SRP driver such that it can hold a reference to a namespace that can

> last longer than the lifetime of the process through which the

> namespace reference was obtained.

> 

> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>

> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

> ---

>  lib/kobject.c | 2 ++

>  1 file changed, 2 insertions(+)

> 

> diff --git a/lib/kobject.c b/lib/kobject.c

> index 763d70a18941..06b849eee0ca 100644

> --- a/lib/kobject.c

> +++ b/lib/kobject.c

> @@ -1039,6 +1039,7 @@ void *kobj_ns_grab_current(enum kobj_ns_type type)

>  

>  	return ns;

>  }

> +EXPORT_SYMBOL_GPL(kobj_ns_grab_current);

>  

>  const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk)

>  {

> @@ -1074,3 +1075,4 @@ void kobj_ns_drop(enum kobj_ns_type type, void *ns)

>  		kobj_ns_ops_tbl[type]->drop_ns(ns);

>  	spin_unlock(&kobj_ns_type_lock);

>  }

> +EXPORT_SYMBOL_GPL(kobj_ns_drop);


Hi Greg,

I'd like to repost this series to address a bug in patch 5/5 of this series.
But before I do that, can you tell me whether I perhaps should widen the
Cc-list for patch 1/5 of this series?

Thanks,

Bart.
Greg KH Jan. 9, 2018, 6:30 p.m. UTC | #2
On Tue, Jan 09, 2018 at 05:59:45PM +0000, Bart Van Assche wrote:
> On Mon, 2018-01-08 at 15:14 -0800, Bart Van Assche wrote:
> > Make it possible to call these two functions from a kernel module.
> > Note: despite their name, these two functions can be used meaningfully
> > independent of kobjects. A later patch will add calls to these
> > functions from the SRP driver because this patch series modifies the
> > SRP driver such that it can hold a reference to a namespace that can
> > last longer than the lifetime of the process through which the
> > namespace reference was obtained.
> > 
> > Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > ---
> >  lib/kobject.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/lib/kobject.c b/lib/kobject.c
> > index 763d70a18941..06b849eee0ca 100644
> > --- a/lib/kobject.c
> > +++ b/lib/kobject.c
> > @@ -1039,6 +1039,7 @@ void *kobj_ns_grab_current(enum kobj_ns_type type)
> >  
> >  	return ns;
> >  }
> > +EXPORT_SYMBOL_GPL(kobj_ns_grab_current);
> >  
> >  const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk)
> >  {
> > @@ -1074,3 +1075,4 @@ void kobj_ns_drop(enum kobj_ns_type type, void *ns)
> >  		kobj_ns_ops_tbl[type]->drop_ns(ns);
> >  	spin_unlock(&kobj_ns_type_lock);
> >  }
> > +EXPORT_SYMBOL_GPL(kobj_ns_drop);
> 
> Hi Greg,
> 
> I'd like to repost this series to address a bug in patch 5/5 of this series.
> But before I do that, can you tell me whether I perhaps should widen the
> Cc-list for patch 1/5 of this series?

I have no idea why you need these functions, as I don't see any of these
other patches.  Please resend the whole series please.

I will note that no driver had better be mucking around with a "raw"
kobject, or I am going to be very mad...

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bart Van Assche Jan. 9, 2018, 6:47 p.m. UTC | #3
On Tue, 2018-01-09 at 19:30 +0100, gregkh@linuxfoundation.org wrote:
> On Tue, Jan 09, 2018 at 05:59:45PM +0000, Bart Van Assche wrote:

> > I'd like to repost this series to address a bug in patch 5/5 of this series.

> > But before I do that, can you tell me whether I perhaps should widen the

> > Cc-list for patch 1/5 of this series?

> 

> I have no idea why you need these functions, as I don't see any of these

> other patches.  Please resend the whole series please.

> 

> I will note that no driver had better be mucking around with a "raw"

> kobject, or I am going to be very mad...


Hello Greg,

To allow you to have a look at the code that adds calls in a module to the
namespace functions I had Cc'ed you for the entire series. Patch 5/5 of this
series adds calls to the namespace functions exported through this patch.
That patch is also available here:
https://www.spinics.net/lists/linux-rdma/msg59190.html.

Thanks,

Bart.
Greg KH Jan. 9, 2018, 6:57 p.m. UTC | #4
On Tue, Jan 09, 2018 at 06:47:29PM +0000, Bart Van Assche wrote:
> On Tue, 2018-01-09 at 19:30 +0100, gregkh@linuxfoundation.org wrote:
> > On Tue, Jan 09, 2018 at 05:59:45PM +0000, Bart Van Assche wrote:
> > > I'd like to repost this series to address a bug in patch 5/5 of this series.
> > > But before I do that, can you tell me whether I perhaps should widen the
> > > Cc-list for patch 1/5 of this series?
> > 
> > I have no idea why you need these functions, as I don't see any of these
> > other patches.  Please resend the whole series please.
> > 
> > I will note that no driver had better be mucking around with a "raw"
> > kobject, or I am going to be very mad...
> 
> Hello Greg,
> 
> To allow you to have a look at the code that adds calls in a module to the
> namespace functions I had Cc'ed you for the entire series. Patch 5/5 of this
> series adds calls to the namespace functions exported through this patch.
> That patch is also available here:
> https://www.spinics.net/lists/linux-rdma/msg59190.html.

Ah, I see it now.

You do realize I've been a _bit_ busy, and for a patch you sent
_YESTERDAY_, it might take me a while to get to...

Please be patient.

greg k-h

> 
> Thanks,
> 
> Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bart Van Assche Jan. 17, 2018, 4:13 p.m. UTC | #5
T24gVHVlLCAyMDE4LTAxLTA5IGF0IDE5OjU3ICswMTAwLCBncmVna2hAbGludXhmb3VuZGF0aW9u
Lm9yZyB3cm90ZToNCj4gWW91IGRvIHJlYWxpemUgSSd2ZSBiZWVuIGEgX2JpdF8gYnVzeSwgYW5k
IGZvciBhIHBhdGNoIHlvdSBzZW50DQo+IF9ZRVNURVJEQVlfLCBpdCBtaWdodCB0YWtlIG1lIGEg
d2hpbGUgdG8gZ2V0IHRvLi4uDQo+IA0KPiBQbGVhc2UgYmUgcGF0aWVudC4NCg0KSGVsbG8gR3Jl
ZywNCg0KRG8geW91IHRoaW5rIHlvdSB3aWxsIGhhdmUgdGhlIHRpbWUgdG8gcmV2aWV3IHBhdGNo
IDEvNSBvZiB0aGlzIHNlcmllcyBiZWZvcmUNCnRoZSBtZXJnZSB3aW5kb3cgb3BlbnMgKGVuZCBv
ZiB0aGlzIHdlZWspPw0KDQpUaGFua3MsDQoNCkJhcnQu
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/lib/kobject.c b/lib/kobject.c
index 763d70a18941..06b849eee0ca 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -1039,6 +1039,7 @@  void *kobj_ns_grab_current(enum kobj_ns_type type)
 
 	return ns;
 }
+EXPORT_SYMBOL_GPL(kobj_ns_grab_current);
 
 const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk)
 {
@@ -1074,3 +1075,4 @@  void kobj_ns_drop(enum kobj_ns_type type, void *ns)
 		kobj_ns_ops_tbl[type]->drop_ns(ns);
 	spin_unlock(&kobj_ns_type_lock);
 }
+EXPORT_SYMBOL_GPL(kobj_ns_drop);