Mark a pointer as an userspace pointer using __user macro.
PATCH 1/1 Mark a pointer as an userspace pointer using __user macro.
This change fixes below sparse error: "error: incompatible types in comparison expression (different address spaces)"
--- drivers/staging/lustre/lnet/selftest/conrpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/lustre/lnet/selftest/conrpc.c +3 -3
@@ -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; - next = tmp.next; +if (next == head_up) +return 0 ; ent =list_entry (next, lstcon_rpc_ent_t, rpe_link);
Signature · 1 line
2.7.4
Greg KH
maintainerPATCH 1/1 Mark a pointer as an userspace pointer using __user macro.
Quoted 7 lines · Antoine BLIN
This change fixes below sparse error: "error: incompatible types in comparison expression (different address spaces)"
Signed-off-by Antoine BLIN <[email protected]>--- 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.
drivers/staging/lustre/lnet/selftest/conrpc.c lstcon_rpc_trans_interpreter(lstcon_rpc_trans_t *trans, · line 493
Quoted 12 lines
drivers/staging/lustre/lnet/selftest/conrpc.c +1
-2@@ -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
PATCH 1/1 Mark a pointer as an userspace pointer using __user macro.
In reply to Antoine BLINQuoted 5 lines
This change fixes below sparse error: "error: incompatible types in comparison expression (different address spaces)"
Signed-off-by Antoine BLIN <[email protected]>
Sigh, I thought the worst was behind us for the LNet/libcfs cleanup. I agree with Greg this is just papering over the problem. Properly fixing this will require the tools to be fixed as well. I wonder if ioctls are best way to handle this, perhaps debugfs?
Quoted 30 lines
--- drivers/staging/lustre/lnet/selftest/conrpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/staging/lustre/lnet/selftest/conrpc.c +3
-3@@ -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; - next = tmp.next; +if (next == head_up) +return 0 ; ent =list_entry (next, lstcon_rpc_ent_t, rpe_link);Signature · 6 lines
2.7.4 _______________________________________________ lustre-devel mailing list lustre-devel at lists.lustre.org http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org