- 03 Feb, 2016 40 commits
-
-
Oleg Drokin authored
When calling ll_fid2path, it expects a userspace pointer. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
unsigned long user address must be casted with __user attribute to make sparse happy when used with userspace access functions. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
Since it is a userspace pointer, this makes things neater and sparse happier. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
This makes sparse happy too. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
When casting unsigned long userspace pointer for use with userspace-accessing functions, need to use __user attribute to make sparse happy. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
This shuts some sparse address space mismatch warnings Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
Casts for get/put_user and copy_to/from_user should have __user attribute for the userspace buffer address. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
This is a user pointer, so that makes sparse a lot happier. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
Cannot use memcpy, but use copy_to/from_user instead Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
Also update all callers. This fixes a bunch of address space mismatch warnings from sparse. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
sysfs store methods provide us with a kernel buffer already, but lprocfs_write_helper is expecting a user buffer. Replace lprocfs_write_helper with kstrto[u]int() calls instead in contention_seconds_store() and lockless_truncate_store() Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
The buffer that lprocfs_write_frac_u64_helper is working on is presumed to be a userspace one, so it's not suitable for use on kernel buffers. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
This also silents a sparse address space warning Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
Also update all methods and calls everywhere. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
For some crazy reason ll_obd_statfs decided to decode async flag passed from userspace and then pass it via a userspace pointer argument to lov_iocontrol. This patch moves flags decoding to lov_iocontrol where it belongs. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
This also happens to silence sparce warnings about different address spaces. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
arg is a userspace pointer and marking it as such makes sparse happy. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
Make them void __user * instead of char * (or char __user *), void * removes the necessity of explicit casts to proper type where people also need to remember __user qualifiers, so I think it works better here. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
Make them void __user * instead of char * (or char __user *), void * removes the necessity of explicit casts to proper type where people also need to remember __user qualifiers, so I think it works better here. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
Just make clear which pointers are from userspace and which are not in libcfs_ioctl_getdata/libcfs_ioctl_popdata and their callers. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
John L. Hammond authored
In lustre/obdecho/echo_client.c, remove handling of lov_stripe_md passed from userspace (since userspace never passes it). Remove the LOV specific code (ed_next_islov) from the echo client (since it doesn't work). Remove echo_get_stripe_off_id() and all calls to it since the stripe count of the passed in lsm is always 0 and the funciton does nothing in this case. Remove the then unused lsm parameters of echo_client_page_debug_setup() and echo_client_page_debug_check(). In the OBD_IOC_GETATTR and OBD_IOC_SETATTR cases of echo_client_iocontrol() do not set the oi_md member of struct obd_info since only LOV OBD methods access it. Signed-off-by: John L. Hammond <john.hammond@intel.com> Reviewed-on: http://review.whamcloud.com/12446 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5814Reviewed-by: Bobi Jam <bobijam@gmail.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
Remove long unused ECHO_IOC_GET_STRIPE, ECHO_IOC_SET_STRIPE, ECHO_IOC_ENQUEUE and ECHO_IOC_CANCEL ioctls. Signed-off-by: John L. Hammond <john.hammond@intel.com> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
This has been unused for ages and could be safely removed now. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
IOC_LIBCFS_DEBUG_PEER was added back in the stone ages to print debug statistics on a peer when peer timeout happens. Redo it properly as a separate LNet API call, also get rid of "ioctl" forwarding into the underlying LNDs, since no current LNDs implement this function anymore. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
It's not used anywhere outside of api-ni.c anyway. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Julia Lawall authored
This export_operations structure is never modified, so declare it as const. Most other structures of this type are already const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Julia Lawall authored
These lu_device_operations and cl_device_operations structures are never modified, so declare them as const. Other structures of these types are already const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Joshua Clayton authored
nrs_resource_put_safe() might hold a lock one one struct while operating on the other. There are 2 levels of structures. Use nrs_policy_put(), which has locking baked in. sparse gives the following warning: drivers/staging/lustre//lustre/ptlrpc/nrs.c:498:39: warning: context imbalance in 'nrs_resource_put_safe' - different lock contexts for basic block Signed-off-by: Joshua Clayton <stillcompiling@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Valdis Kletnieks authored
Clean up another case of the compiler remininding the programmer they are an idiot: drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c:308:34: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] LASSERT(page_pools.epp_waitqlen >= 0); Just lose the assert, and save a page of compiler spew. Signed-off-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Valdis Kletnieks authored
Writing asserts for almost-never-can-happen things can be valuable. Writing an assert that tests that an "unsigned int" hasn't gone negative isn't. And it generates an *ugly* message: drivers/staging/lustre/lustre/llite/rw.c:763:20: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] LASSERTF(reserved >= 0, "reserved %lu\n", reserved); ^ include/linux/compiler.h:137:45: note: in definition of macro 'unlikely' # define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0)) ^ drivers/staging/lustre/lustre/llite/rw.c:763:2: note: in expansion of macro 'LASSERTF' LASSERTF(reserved >= 0, "reserved %lu\n", reserved); ^ drivers/staging/lustre/lustre/llite/rw.c:763:20: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] LASSERTF(reserved >= 0, "reserved %lu\n", reserved); ^ include/linux/compiler.h:137:53: note: in definition of macro 'unlikely' # define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0)) ^ drivers/staging/lustre/lustre/llite/rw.c:763:2: note: in expansion of macro 'LASSERTF' LASSERTF(reserved >= 0, "reserved %lu\n", reserved); ^ drivers/staging/lustre/lustre/llite/rw.c:763:20: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] LASSERTF(reserved >= 0, "reserved %lu\n", reserved); ^ include/linux/compiler.h:110:47: note: in definition of macro 'likely_notrace' #define likely_notrace(x) __builtin_expect(!!(x), 1) ^ include/linux/compiler.h:137:58: note: in expansion of macro '__branch_check__' # define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0)) ^ drivers/staging/lustre/lustre/llite/../include/linux/../../../include/linux/libcfs/libcfs_private.h:58:6: note: in expansion of macro 'unlikely' if (unlikely(!(cond))) { \ ^ drivers/staging/lustre/lustre/llite/rw.c:763:2: note: in expansion of macro 'LASSERTF' LASSERTF(reserved >= 0, "reserved %lu\n", reserved); ^ Umm, thank you, GCC. We'll delete the problem line so we never see that spew again. Signed-off-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Valdis Kletnieks authored
CC [M] drivers/staging/lustre/lustre/libcfs/module.o drivers/staging/lustre/lustre/libcfs/module.c: In function 'lustre_insert_debugfs': drivers/staging/lustre/lustre/libcfs/module.c:670:17: warning: variable 'entry' set but not used [-Wunused-but-set-variable] struct dentry *entry; ^ Just ignore the dentry returned, and add a comment that we *know* we're not really leaking the dentry because something else will be able to reap it via recursion. Signed-off-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Valdis Kletnieks authored
drivers/staging/lustre/lustre/fid/../include/lustre_cfg.h: In function 'lustre_cfg_free': drivers/staging/lustre/lustre/fid/../include/lustre_cfg.h:253:6: warning: variable 'len' set but not used [-Wunused-but-set-variable] int len; Yep, we're just gonna call kfree, no need to calculate len. Bye-bye. Signed-off-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Valdis Kletnieks authored
drivers/staging/lustre/lustre/fid/lproc_fid.c: In function 'ldebugfs_fid_write_common': drivers/staging/lustre/lustre/fid/lproc_fid.c:67:6: warning: variable 'rc' set but not used [-Wunused-but-set-variable] int rc; We fix it by *using* the return code to help bulletproof it. It says it's test code - it should be *more* bulletproof than production, not less. Signed-off-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Valdis Kletnieks authored
Low-hanging fruit first: CC [M] drivers/staging/lustre/lustre/fid/fid_request.o In file included from drivers/staging/lustre/lustre/fid/../include/lustre_net.h:66:0, from drivers/staging/lustre/lustre/fid/../include/lustre_lib.h:64, from drivers/staging/lustre/lustre/fid/../include/obd.h:52, from drivers/staging/lustre/lustre/fid/fid_request.c:48: drivers/staging/lustre/lustre/fid/../include/lu_object.h:765:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration] static const inline struct lu_device_operations * ^ So we just swap inline and const. 272 warnings gone. :) Signed-off-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
James Simmons authored
Cleanup the last white space issues in the kernel comm code. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
James Simmons authored
Doing if (rc != 0) or if (rc == 0) is bad form. This patch corrects kernelcomm.c to behavior according to kernel coding standards. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
James Simmons authored
The functon libcfs_kkuc_msg_put() returns -ENOSYS which is not correct. Return -ENXIO instead if the kuc header is corrupt. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
James Simmons authored
Add in missing braces for libcfs_kkuc_group_put();. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
James Simmons authored
Add in missing space arouund '+' in the kernel_comm code. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
James Simmons authored
Fixup the comments to the linux kernel style for the source and headers related to the kernel_comm work. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-