[lustre-devel] [PATCH] Mark a pointer as an userspace pointer using __user macro.

Greg KH gregkh at linuxfoundation.org
Sun Apr 10 08:39:59 PDT 2016


On Sun, Apr 10, 2016 at 02:46:40PM +0200, Antoine BLIN wrote:
> This change fixes below sparse error: "error: incompatible types
> in comparison expression (different address spaces)"
> 
> Signed-off-by: Antoine BLIN <antoine.blin at lip6.fr>
> ---
>  drivers/staging/lustre/lnet/selftest/conrpc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Please always cc: the driverdev mailing list for staging patches.

Also use the name of the driver, and the subsystem in the patch, like
the others written for this driver, look at 'git log' for details.

> 
> diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c
> index 2be9451..1fdabb3 100644
> --- a/drivers/staging/lustre/lnet/selftest/conrpc.c
> +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
> @@ -490,10 +490,10 @@ lstcon_rpc_trans_interpreter(lstcon_rpc_trans_t *trans,
>  				   sizeof(struct list_head)))
>  			return -EFAULT;
>  
> -		if (tmp.next == head_up)
> -			return 0;
> +		next = (struct list_head __user *)tmp.next;

Kernel structures in userspace?  While that might be the case, this
really should be fixed "properly" and not papered over like this, sorry.

Do you have access to a lustre system to test changes like this?

thanks,

greg k-h


More information about the lustre-devel mailing list