Whamcloud - gitweb
LU-16723 parser: fix help hanging 39/51339/2
authorTimothy Day <timday@amazon.com>
Fri, 16 Jun 2023 04:58:42 +0000 (04:58 +0000)
committerOleg Drokin <green@whamcloud.com>
Sat, 8 Jul 2023 22:36:44 +0000 (22:36 +0000)
commit0d77e94b47936f50a435aea623e4a12d812a696b
tree7d9c7840368e2613c37937cd86e16ff72df0e2b3
parent46a9abf4330e7a12fde41fb922d6dfc4547c6243
LU-16723 parser: fix help hanging

Running a command such as 'lctl pcc help v' will
hang indefinitely. This is due to a bug in find_cmd,
return pointers from two different arrays.

This is fixed by setting top_level to be the
concatenation of the override_cmdlist and the
regular cmds.

Also, rather than recursing forever, give up after
reaching an arbitrary depth.

Improve several help messages so that users will
have a better idea why their commands aren't
working.

Fixes: 21080400f9 ("LU-16723 libcfs: refactor parser to be simpler")
Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: Ib22bc71e5952b1beb868bbe37bc8f6b08c94ff72
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51339
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/include/libcfs/util/parser.h
libcfs/libcfs/util/parser.c