Re: rename probe_kernel_* and probe_user_*

From: Linus Torvalds
Date: Wed Jun 17 2020 - 14:11:36 EST


On Wed, Jun 17, 2020 at 12:38 AM Christoph Hellwig <hch@xxxxxx> wrote:
>
> Feel free to directly apply these patches.

Ok, locally applied to a separate branch, will merge once I've done
more testing.

HOWEVER.

As I applied this, I noticed that we have a lot of code of the pattern

copy_from_kernel_nofault(&x, y, sizeof(x));

which is just an inconvenient and less readable way to write that

get_kernel_nofault(x, y);

Also, some of the places that *do* use get_kernel_nofault() seem
questionable, and use a cast on 'x'.

I'm actually a bit surprised that we don't even get a warning for that
horrible pattern that smells a bit like the gcc 'cast as lvalue'
thing.

Linus