Whamcloud - gitweb
LU-12198 libcfs: always copy ioctl header back to user 59/37559/3
authorDominique Martinet <dominique.martinet@cea.fr>
Thu, 13 Feb 2020 13:36:32 +0000 (13:36 +0000)
committerOleg Drokin <green@whamcloud.com>
Tue, 25 Feb 2020 05:51:45 +0000 (05:51 +0000)
commit9e02ef474f8caa833d6a1b5e0068d5323a57e8c4
tree5c402d6aeac4a5f3cbb8e260d01266a10f5f309f
parentdfb4afc24102ee305d4901dc76944f4c91887633
LU-12198 libcfs: always copy ioctl header back to user

lnetctl_get_peer_list fills back the required size in header if the
given buffer was too small. Userspace needs the info back to grow
the buffer and try again.

Note we only replace err on failure if err was previously not set

Fixes: fba98579efc4 ("LU-6202 libcfs: replace libcfs_register_ioctl with a blocking notifier_chain")
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
Change-Id: I2b6e319aceeb00d488572053d27023891afe1928
Reviewed-on: https://review.whamcloud.com/37559
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Neil Brown <neilb@suse.de>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/libcfs/module.c