* [PATCH] Use the tsk argument in init_new_context()
@ 2007-07-09 1:55 Diego Woitasen
2007-07-20 0:42 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Diego Woitasen @ 2007-07-09 1:55 UTC (permalink / raw)
To: akpm, linux-kernel; +Cc: Diego Woitasen
Signed-off-by: Diego Woitasen <diego@woitasen.com.ar>
---
arch/i386/kernel/ldt.c | 2 +-
arch/x86_64/kernel/ldt.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/i386/kernel/ldt.c b/arch/i386/kernel/ldt.c
index e0b2d17..c2eb4fb 100644
--- a/arch/i386/kernel/ldt.c
+++ b/arch/i386/kernel/ldt.c
@@ -96,7 +96,7 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
init_MUTEX(&mm->context.sem);
mm->context.size = 0;
- old_mm = current->mm;
+ old_mm = tsk->mm;
if (old_mm && old_mm->context.size > 0) {
down(&old_mm->context.sem);
retval = copy_ldt(&mm->context, &old_mm->context);
diff --git a/arch/x86_64/kernel/ldt.c b/arch/x86_64/kernel/ldt.c
index bc9ffd5..99a92ed 100644
--- a/arch/x86_64/kernel/ldt.c
+++ b/arch/x86_64/kernel/ldt.c
@@ -100,7 +100,7 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
init_MUTEX(&mm->context.sem);
mm->context.size = 0;
- old_mm = current->mm;
+ old_mm = tsk->mm;
if (old_mm && old_mm->context.size > 0) {
down(&old_mm->context.sem);
retval = copy_ldt(&mm->context, &old_mm->context);
--
1.5.2.3
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] Use the tsk argument in init_new_context()
2007-07-09 1:55 [PATCH] Use the tsk argument in init_new_context() Diego Woitasen
@ 2007-07-20 0:42 ` Andrew Morton
2007-07-21 1:00 ` Diego Woitasen
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2007-07-20 0:42 UTC (permalink / raw)
To: Diego Woitasen; +Cc: linux-kernel
On Sun, 8 Jul 2007 22:55:08 -0300
Diego Woitasen <diego@woitasen.com.ar> wrote:
> Signed-off-by: Diego Woitasen <diego@woitasen.com.ar>
> ---
> arch/i386/kernel/ldt.c | 2 +-
> arch/x86_64/kernel/ldt.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/i386/kernel/ldt.c b/arch/i386/kernel/ldt.c
> index e0b2d17..c2eb4fb 100644
> --- a/arch/i386/kernel/ldt.c
> +++ b/arch/i386/kernel/ldt.c
> @@ -96,7 +96,7 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
>
> init_MUTEX(&mm->context.sem);
> mm->context.size = 0;
> - old_mm = current->mm;
> + old_mm = tsk->mm;
> if (old_mm && old_mm->context.size > 0) {
> down(&old_mm->context.sem);
> retval = copy_ldt(&mm->context, &old_mm->context);
> diff --git a/arch/x86_64/kernel/ldt.c b/arch/x86_64/kernel/ldt.c
> index bc9ffd5..99a92ed 100644
> --- a/arch/x86_64/kernel/ldt.c
> +++ b/arch/x86_64/kernel/ldt.c
> @@ -100,7 +100,7 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
>
> init_MUTEX(&mm->context.sem);
> mm->context.size = 0;
> - old_mm = current->mm;
> + old_mm = tsk->mm;
> if (old_mm && old_mm->context.size > 0) {
> down(&old_mm->context.sem);
> retval = copy_ldt(&mm->context, &old_mm->context);
When called from dup_mm(), `tsk' refers to the new task and `current'
refers to the old one. I'd have expected this to crash during your testing?
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] Use the tsk argument in init_new_context()
2007-07-20 0:42 ` Andrew Morton
@ 2007-07-21 1:00 ` Diego Woitasen
0 siblings, 0 replies; 3+ messages in thread
From: Diego Woitasen @ 2007-07-21 1:00 UTC (permalink / raw)
To: Andrew Morton; +Cc: Diego Woitasen, linux-kernel
On Thu, Jul 19, 2007 at 05:42:38PM -0700, Andrew Morton wrote:
> On Sun, 8 Jul 2007 22:55:08 -0300
> Diego Woitasen <diego@woitasen.com.ar> wrote:
>
> > Signed-off-by: Diego Woitasen <diego@woitasen.com.ar>
> > ---
> > arch/i386/kernel/ldt.c | 2 +-
> > arch/x86_64/kernel/ldt.c | 2 +-
> > 2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/i386/kernel/ldt.c b/arch/i386/kernel/ldt.c
> > index e0b2d17..c2eb4fb 100644
> > --- a/arch/i386/kernel/ldt.c
> > +++ b/arch/i386/kernel/ldt.c
> > @@ -96,7 +96,7 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
> >
> > init_MUTEX(&mm->context.sem);
> > mm->context.size = 0;
> > - old_mm = current->mm;
> > + old_mm = tsk->mm;
> > if (old_mm && old_mm->context.size > 0) {
> > down(&old_mm->context.sem);
> > retval = copy_ldt(&mm->context, &old_mm->context);
> > diff --git a/arch/x86_64/kernel/ldt.c b/arch/x86_64/kernel/ldt.c
> > index bc9ffd5..99a92ed 100644
> > --- a/arch/x86_64/kernel/ldt.c
> > +++ b/arch/x86_64/kernel/ldt.c
> > @@ -100,7 +100,7 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
> >
> > init_MUTEX(&mm->context.sem);
> > mm->context.size = 0;
> > - old_mm = current->mm;
> > + old_mm = tsk->mm;
> > if (old_mm && old_mm->context.size > 0) {
> > down(&old_mm->context.sem);
> > retval = copy_ldt(&mm->context, &old_mm->context);
>
>
> When called from dup_mm(), `tsk' refers to the new task and `current'
> refers to the old one. I'd have expected this to crash during your testing?
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
Yes, sorry... that patch is bad. Now my question is, why all
architectures have the task argument and neither use it? I undertand now
that init_new_context() work with current but what about the *tsk arg.
--
--------------
Diego Woitasen
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-07-21 1:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-09 1:55 [PATCH] Use the tsk argument in init_new_context() Diego Woitasen
2007-07-20 0:42 ` Andrew Morton
2007-07-21 1:00 ` Diego Woitasen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome