Whamcloud - gitweb
LU-18680 ptlrpc: Improve yaml output for nodemap offset 85/58085/2
authorMarc Vef <mvef@whamcloud.com>
Fri, 14 Feb 2025 11:14:22 +0000 (12:14 +0100)
committerOleg Drokin <green@whamcloud.com>
Fri, 28 Feb 2025 08:14:54 +0000 (08:14 +0000)
commit1ef4ea3462e15a7ab26c39b0d532dad2a0745931
tree7b5fafb57dd6b7185f65f9a444eb7ab85d7f581a
parent145e315b0eefbbfd9ec0ded44560c02aa37877e5
LU-18680 ptlrpc: Improve yaml output for nodemap offset

Nodemap offset presents loose values on lctl get_param:
$ lctl get_param -n nodemap.t0.offset
start_uid: 100000
limit_uid: 200000
start_gid: 100000
limit_gid: 200000
start_projid: 100000
limit_projid: 200000

This is technically valid YAML syntax, but not contextually bound as a
unit or to its key "offset". In the future, we want to save/restore
entire nodemap configurations. This means that the key "offset" is
necessary to relate the values to. This can be done via indenting or
more explicitly with {}, as done in this patch to be consistent with
other nodemap properties like ranges or idmap and to not necessarily
rely on indentation:
$ lctl get_param -n nodemap.t0.offset
{
 start_uid: 100000,
 limit_uid: 200000,
 start_gid: 100000,
 limit_gid: 200000,
 start_projid: 100000,
 limit_projid: 200000
}

Note, offsets are always shown even for zero, thus {} is not
shown when no offsets are defined.

Test-Parameters: trivial testlist=sanity-sec env=ONLY=27ab
Signed-off-by: Marc Vef <mvef@whamcloud.com>
Change-Id: I9b9a5411c3adcd39d45f29c8fc1d8c51163ba9b5
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58085
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Aurelien Degremont <adegremont@nvidia.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/ptlrpc/nodemap_lproc.c