Whamcloud - gitweb
LU-11566 utils: fix lctl llog_print for large configs 50/34850/2
authorAndreas Dilger <adilger@whamcloud.com>
Mon, 10 Dec 2018 10:18:19 +0000 (03:18 -0700)
committerOleg Drokin <green@whamcloud.com>
Sat, 8 Jun 2019 02:33:03 +0000 (02:33 +0000)
commitc1b11bf102ea73860fcb65afceb99db5b4fcc2e2
treeda385ac1417cb082548bb74c2dfd3c03f649a84d
parent075ef34fe174d6cefa79e35762300e3e85a53c95
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.

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

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-on: https://review.whamcloud.com/34850
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Chris Horn <hornc@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