Whamcloud - gitweb
LU-5935 lnet: Fixes to make lnetctl function as expected. 82/12782/11
authorJames Simmons <uja.ornl@gmail.com>
Mon, 15 Dec 2014 22:20:31 +0000 (17:20 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 7 Jan 2015 17:02:03 +0000 (17:02 +0000)
commit2bcfce77a2712960fadac2f034c1df4826780608
tree78643e21c3d91d974f712e0054c82e82c7b0f0a2
parent90cad4dad6c3e5607fa91f830959da4df4a5d434
LU-5935 lnet: Fixes to make lnetctl function as expected.

During testing of the lnetctl utility I ran into some
issues. One of the problems is when you print out help
for peer_credits you get help for stats. With this patch
the help option for peer_credits is set to return the
proper help message.

The second problem was for grabbing stats data. No data
was returned but instead it reported a error. The reason
for this is that libcfs_ioctl_getdata() test to see if the
size of the data passed in is less than the struct
libcfs_ioctl_data in size. For the stats function its
data structure struct lnet_ioctl_lnet_stats is smaller
than what is allowed. Instead of checking if the data
is less than libcfs_ioctl_data in size we check to ensure
that the data is not smaller than the ioctl hdr data which
is universal.

The bug in libcfs_ioctl_getdata() exposed a bunch of cases
with new ioctls that don't check to see if the data imported
from userland equals the size reported in the ioctl hdr
data. We address those cases in this patch as well.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: Ib5abc288d94b0f93549312a3fe283cbb8205febf
Reviewed-on: http://review.whamcloud.com/12782
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
libcfs/include/libcfs/libcfs_ioctl.h
libcfs/libcfs/linux/linux-module.c
lnet/lnet/api-ni.c
lnet/utils/.gitignore
lnet/utils/lnetconfig/liblnetconfig.c
lnet/utils/lnetctl.c