drivers: staging/lustre: lmv_obd.c - suppress Sparse user cast warning
PATCH 1/1 drivers: staging/lustre: lmv_obd.c - suppress Sparse user cast warning
Comment above assignment states that uarg does not point to user space memory (ll_dir_ioctl does copy_from_user), so this is a valid cast. This patch adds a __force annotation to suppress the "cast removes address space of expression" Sparse warning.
--- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/lmv/lmv_obd.c +1 -1
@@ -989,7 +989,7 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,* Note: this is from llite(see ll_dir_ioctl()), @uarg does not * point to user space memory for FID2MDTIDX. */ - *(__u32 *)uarg = mdt_index; + *(__force __u32 *)uarg = mdt_index;break ; }case OBD_IOC_FID2PATH : {
Signature · 1 line
2.11.0
PATCH 1/1 drivers: staging/lustre: lmv_obd.c - suppress Sparse user cast warning
Quoted 15 lines · Michael Sartain
Comment above assignment states that uarg does not point to user space memory (
ll_dir_ioctldoescopy_from_user), so this is a valid cast. This patch adds a__forceannotation to suppress the "cast removes address space of expression" Sparse warning.Signed-off-by Michael Sartain <[email protected]>--- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/lustre/lustre/lmv/lmv_obd.c +0
-0
drivers/staging/lustre/lustre/lmv/lmv_obd.c static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp, · line 992
Quoted 5 lines
drivers/staging/lustre/lustre/lmv/lmv_obd.c +1
-1@@ -989,7 +989,7 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,* Note: this is from llite(see ll_dir_ioctl()), @uarg does not * point to user space memory for FID2MDTIDX. */ - *(__u32 *)uarg = mdt_index; + *(__force __u32 *)uarg = mdt_index;
Really? This is correct? If so, ugh, something is really wrong with the lustre code and it should be fixed "correctly".
thanks,
greg k-h