LU-13791 mdt: allow using symbolic capability names
Allow "mdt.*.enable_cap_mask" param set and print symbolic names,
similar to the "debug" and "subsystem_debug" parameters. The
allowed parameter names are in the capabilities(7) man page, in
either upper or lowercase, like cap_chown, cap_dac_read_search,
etc. along with "all" to enable all capabilities if clients are
trusted. For example:
lctl set_param -P mdt.lfs-*.enable_cap_mask=+cap_dac_read_search
Since kernel_cap_t is a 64-bit value, enhance cfs_str2mask() to
take u64 mask arguments. The calling libcfs_debug_str2mask()
sticks with "int mask" for now.
Split the core out from libcfs_debug_mask2str() into a new helper
function cfs_mask2str() so it can be called directly.
Fixes:
54f677651b ("LU-13791 mdt: parameter to tune capabilities")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I3f71f61a17d4d3614e46a526c60e709d9eb825b3
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54118
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexander Zarochentsev <alexander.zarochentsev@hpe.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>