Whamcloud - gitweb
LU-11566 utils: fix lctl llog_print for large configs 15/33815/8
authorAndreas Dilger <adilger@whamcloud.com>
Mon, 10 Dec 2018 10:18:19 +0000 (03:18 -0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 30 Jan 2019 02:40:35 +0000 (02:40 +0000)
commit3783aa285b15a811081a8de829d52f7f83e91209
tree5c9d5dc7a0fff1397712e97f622a72849a475e20
parentdf0bcc96ee578d6661fcc63e82b94e1e569f9efe
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 (rename set_param -F test_123 to test_123F).
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.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ib7d2ae893033bd4594646c980b7d0ddbd2b3a089
Reviewed-on: https://review.whamcloud.com/33815
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: Oleg Drokin <green@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