Re: my slab cache broken on sparc64

Roman Zippel (zippel@linux-m68k.org)
Sat, 4 May 2002 11:46:01 +0200 (CEST)


Hi

On Fri, 3 May 2002, David S. Miller wrote:

> If the __get_user() fails, you will leave the kernel in the
> KERNEL_DS segment.
>
> Do it like this instead.
>
> int fault;
> mm_segment_t old_fs;
>
> ...
>
> old_fs = get_fs();
> set_fs(KERNEL_DS);
> fault = __get_user(tmp, pc->name);
> set_fs(old_fs);
>
> if (fault) {
> ...

He can also simply move it outside of the loop to avoid this problem.

bye, Roman

-
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/