Re: [PATCH] m68k, exec: remove redundant set_fs(USER_DS)

From: Mathias Krause
Date: Wed Jun 15 2011 - 11:49:46 EST


On Wed, Jun 15, 2011 at 4:40 PM, Geert Uytterhoeven
<geert@xxxxxxxxxxxxxx> wrote:
> On Fri, Jun 10, 2011 at 15:09, Mathias Krause <minipli@xxxxxxxxxxxxxx> wrote:
>> The address limit is already set in flush_old_exec() so those calls to
>> set_fs(USER_DS) are redundant.
>>
>> Signed-off-by: Mathias Krause <minipli@xxxxxxxxxxxxxx>
>> Cc: Greg Ungerer <gerg@xxxxxxxxxxx>
>> ---
>>
>> Note: I'm not sure about the assignment to current->thread.fs in
>> flush_thread() -- shouldn't this be done in set_fs() itself?
>
> set_fs() is used to temporary set the address space to be used from the
> kernel.
> current->thread.fs is the address space that will be used when the
> thread returns
> to userspace.
> So I think it's correct.
>
> For nommu, thread.fs is set, but not really used.

Thanks for the explanation. So only the set_fs() is redundant.

Mathias
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/