Whamcloud - gitweb
LU-11566 utils: fix lctl llog_print for large configs 63/33863/6
authorAndreas Dilger <adilger@whamcloud.com>
Mon, 10 Dec 2018 10:18:19 +0000 (03:18 -0700)
committerOleg Drokin <green@whamcloud.com>
Sat, 23 Feb 2019 05:10:37 +0000 (05:10 +0000)
commita8abec1d666c92eb5003e020488f10d10da82787
tree2fcda3e2d73171e370c21b3747b6e4579abe46dd
parent56c3d06ed66626f79608f3dafbe13b6719edf9cf
LU-11566 utils: fix lctl llog_print for large configs

If "lctl llog_print" is called for a large configuration, it will
overflow the 8KB buffer limit for OBD ioctl commands.  The kernel
snprintf calls try to overflow the supplied buffer.  Avoid that.
If the configuration is large, fetch the configuration records in
chunks and print them incrementally.

Add --start and --end options to llog_print and deprecate the use of
positional parameters, since positional parameters are increasingly
complex to parse as options are added, and are harder to use.

The callback for the configuration records will allow "lctl pool_*"
commands to be processed directly on the MGS.

Move existing llog_print test_60aa, test_60ab to conf-sanity as
test_123aa and test_123ab.
Add new test_123ac and test_123ad for the new llog_print --start and
--end param, and update test_123aa to test old positional parameters.

Lustre-commit: 3783aa285b15a811081a8de829d52f7f83e91209
Lustre-change: https://review.whamcloud.com/33815

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ib7d2ae893033bd4594646c980b7d0ddbd2b3a089
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/33863
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
lustre/doc/lctl-llog_print.8
lustre/obdclass/obd_config.c
lustre/tests/conf-sanity.sh
lustre/tests/sanity.sh
lustre/utils/lctl.c
lustre/utils/obd.c