* [PATCH] export kernel call set_task_comm()
@ 2012-05-31 7:16 majianpeng
2012-05-31 16:00 ` Al Viro
[not found] ` <201206010911269377891@gmail.com>
0 siblings, 2 replies; 5+ messages in thread
From: majianpeng @ 2012-05-31 7:16 UTC (permalink / raw)
To: viro; +Cc: linux-fsdevel
In Commit 7d74f492e4dd0034a61458eb80f70b1d2862ed07,author said:
"This allows drivers who call this function to be compiled modularly.
Otherwise, a driver who is interested in this type of functionality
has to implement their own get_task_comm() call, causing code
duplication in the Linux source tree."
But author did not say about set_task_comm().At present,I used it but
compiled error.To the same purpose, it should export.
Signed-off-by: majianpeng <majianpeng@gmail.com>
---
fs/exec.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/fs/exec.c b/fs/exec.c
index 52c9e2f..2b0178b 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1072,6 +1072,7 @@ void set_task_comm(struct task_struct *tsk, char *buf)
task_unlock(tsk);
perf_event_comm(tsk);
}
+EXPORT_SYMBOL_GPL(set_task_comm);
static void filename_to_taskname(char *tcomm, const char *fn, unsigned int len)
{
--
1.7.5.4
--------------
majianpeng
2012-05-31
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] export kernel call set_task_comm()
2012-05-31 7:16 [PATCH] export kernel call set_task_comm() majianpeng
@ 2012-05-31 16:00 ` Al Viro
2012-06-01 1:15 ` majianpeng
[not found] ` <201206010911269377891@gmail.com>
1 sibling, 1 reply; 5+ messages in thread
From: Al Viro @ 2012-05-31 16:00 UTC (permalink / raw)
To: majianpeng; +Cc: linux-fsdevel
On Thu, May 31, 2012 at 03:16:18PM +0800, majianpeng wrote:
> In Commit 7d74f492e4dd0034a61458eb80f70b1d2862ed07,author said:
> "This allows drivers who call this function to be compiled modularly.
> Otherwise, a driver who is interested in this type of functionality
> has to implement their own get_task_comm() call, causing code
> duplication in the Linux source tree."
>
> But author did not say about set_task_comm().At present,I used it but
> compiled error.To the same purpose, it should export.
Are you doing that to preexisting process? Or just to a kernel thread
you are creating? In the latter case, you really ought to use
kthread_create() instead of bare-metal kernel_thread()...
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Re: [PATCH] export kernel call set_task_comm()
2012-05-31 16:00 ` Al Viro
@ 2012-06-01 1:15 ` majianpeng
0 siblings, 0 replies; 5+ messages in thread
From: majianpeng @ 2012-06-01 1:15 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel
On Thu, 31 May 2012 17:00:54 +0100 , viro wrote:
>On Thu, May 31, 2012 at 03:16:18PM +0800, majianpeng wrote:
>> In Commit 7d74f492e4dd0034a61458eb80f70b1d2862ed07,author said:
>> "This allows drivers who call this function to be compiled modularly.
>> Otherwise, a driver who is interested in this type of functionality
>> has to implement their own get_task_comm() call, causing code
>> duplication in the Linux source tree."
>>
>> But author did not say about set_task_comm().At present,I used it but
>> compiled error.To the same purpose, it should export.
>Are you doing that to preexisting process? Or just to a kernel thread
>you are creating? In the latter case, you really ought to use
>kthread_create() instead of bare-metal kernel_thread()...
Yes, I am doing that to preexisting process and in module.So I think it should export.
------------------
majianpeng
2012-06-01
^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <201206010911269377891@gmail.com>]
* Re: Re: [PATCH] export kernel call set_task_comm()
[not found] ` <201206010911269377891@gmail.com>
@ 2012-06-01 1:24 ` Al Viro
2012-06-01 2:13 ` majianpeng
0 siblings, 1 reply; 5+ messages in thread
From: Al Viro @ 2012-06-01 1:24 UTC (permalink / raw)
To: majianpeng; +Cc: linux-fsdevel
On Fri, Jun 01, 2012 at 09:11:32AM +0800, majianpeng wrote:
> On Thu, 31 May 2012 17:00:54 +0100 , viro wrote:
> >On Thu, May 31, 2012 at 03:16:18PM +0800, majianpeng wrote:
> >> In Commit 7d74f492e4dd0034a61458eb80f70b1d2862ed07,author said:
> >> "This allows drivers who call this function to be compiled modularly.
> >> Otherwise, a driver who is interested in this type of functionality
> >> has to implement their own get_task_comm() call, causing code
> >> duplication in the Linux source tree."
> >>
> >> But author did not say about set_task_comm().At present,I used it but
> >> compiled error.To the same purpose, it should export.
>
> >Are you doing that to preexisting process? Or just to a kernel thread
> >you are creating? In the latter case, you really ought to use
> >kthread_create() instead of bare-metal kernel_thread()...
>
> Yes, I am doing that to preexisting process and in module.So I think it should export.
Why is that module playing with ->comm[] of process it hadn't spawned?
Note that _reading_ ->comm[] has fairly mundane uses - debugging printks
and all such. Changing it, OTOH...
Details, please; "my module calls that, so it should be exported" is not enough.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Re: [PATCH] export kernel call set_task_comm()
2012-06-01 1:24 ` Al Viro
@ 2012-06-01 2:13 ` majianpeng
0 siblings, 0 replies; 5+ messages in thread
From: majianpeng @ 2012-06-01 2:13 UTC (permalink / raw)
To: viro; +Cc: linux-fsdevel
On Thu, 31 May 2012 18:24:47 -0700, viro wrote:
>On Fri, Jun 01, 2012 at 09:11:32AM +0800, majianpeng wrote:
>> On Thu, 31 May 2012 17:00:54 +0100 , viro wrote:
>> >On Thu, May 31, 2012 at 03:16:18PM +0800, majianpeng wrote:
>> >> In Commit 7d74f492e4dd0034a61458eb80f70b1d2862ed07,author said:
>> >> "This allows drivers who call this function to be compiled modularly.
>> >> Otherwise, a driver who is interested in this type of functionality
>> >> has to implement their own get_task_comm() call, causing code
>> >> duplication in the Linux source tree."
>> >>
>> >> But author did not say about set_task_comm().At present,I used it but
>> >> compiled error.To the same purpose, it should export.
>>
>> >Are you doing that to preexisting process? Or just to a kernel thread
>> >you are creating? In the latter case, you really ought to use
>> >kthread_create() instead of bare-metal kernel_thread()...
>>
>> Yes, I am doing that to preexisting process and in module.So I think it should export.
>
>Why is that module playing with ->comm[] of process it hadn't spawned?
>Note that _reading_ ->comm[] has fairly mundane uses - debugging printks
>and all such. Changing it, OTOH...
>
>Details, please; "my module calls that, so it should be exported" is not enough.
This module is md.
It created a thread with kthread_run.But the name is wrong because using some old information.
Because it has mode places like this, so I thought to change the name at run-place .
If so, I can modify the ->comm[] directly?
--------------
majianpeng
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-06-01 2:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-31 7:16 [PATCH] export kernel call set_task_comm() majianpeng
2012-05-31 16:00 ` Al Viro
2012-06-01 1:15 ` majianpeng
[not found] ` <201206010911269377891@gmail.com>
2012-06-01 1:24 ` Al Viro
2012-06-01 2:13 ` majianpeng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).