Whamcloud - gitweb
LU-18401 utils: check_iam, support more iam records types 90/56790/6
authorEtienne AUJAMES <etienne.aujames@cea.fr>
Fri, 25 Oct 2024 10:10:55 +0000 (12:10 +0200)
committerOleg Drokin <green@whamcloud.com>
Mon, 9 Dec 2024 06:13:13 +0000 (06:13 +0000)
commit7b21e7738e510e4767e19f58b84de3d958acc78a
tree54edc3230914b071d832ea9195c40105482404fa
parent029bc1c294c3c78af863ab05524275978f4e1b2d
LU-18401 utils: check_iam, support more iam records types

This patch fix check_iam to support different keysizes (the entries
offset was wrong for keysize other than fid size).

This adds callbacks to print different type of records for different
IAM files.

The type can be specified with the option "-t". If not, the type is
guess from the file name.

If the type is not supported, they keys and records will be dump in
hexadecimal format.

Here the following type of IAM files supported:

- oi.16.*: FID/inode mapping (already supported):

$ check_iam -r /tmp/oi.16.1
[0x200000401:0x448:0x0] 1157/3251524137
[0x200000401:0x449:0x0] 1158/3251524138
...

- lfsck_namespace: LFSCK namespace trace file:

$ check_iam -r /tmp/lfsck_namespace_01
[0:0x0:0x0]     0x0 ()
[0x200000401:0x65:0x0]  0x1 (CHECK_LINKEA)

- lfsck_layout: LFSCK layout trace file:

$ check_iam -r /tmp/lfsck_layout_01
{ parent: [0:0x0:0x0], comp_id: 0, ea_off: 0 }  { cfid: [0:0x0:0x0],
ost_idx: 0 }

- nodemap: nodemap configuration:

$ check_iam -r /tmp/nodemap
{ id: 0x0, type: global(15) }   { is_active: 1 }
{ id: 0x1, type: cluster(1), subtype: cluster } { name: toto, flag:
0xb8, flag2: 0x0, squash_uid: 65534, squash_gid: 65534, squash_projid:
65534}
{ id: 0x1, type: cluster(1), subtype: roles }   { roles: 0xffffffc8}
{ id: 0x1, type: range(2) }     { start_nid: 192.168.1.128@tcp,
end_nid: 192.168.1.130@tcp }

Update regression test: conf-sanity 134

Test-Parameters: trivial
Test-Parameters: testlist=conf-sanity
Test-Parameters: testlist=conf-sanity
Test-Parameters: testlist=conf-sanity env=ONLY=134,ONLY_REPEAT=20
Fixes: 99d1f12c7 ("LU-15581 utils: add check_iam util")
Signed-off-by: Etienne AUJAMES <eaujames@ddn.com>
Change-Id: Ic2cae2cbbf1c29daa661b1916d6321b6d87494dd
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56790
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Artem Blagodarenko <ablagodarenko@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre/libiam.h
lustre/tests/conf-sanity.sh
lustre/utils/Makefile.am
lustre/utils/check_iam.c
lustre/utils/libiam.c