Whamcloud - gitweb
LU-18109 nodemap: fix idmap offset for root 56/57856/6
authorSebastien Buisson <sbuisson@ddn.com>
Wed, 22 Jan 2025 14:20:11 +0000 (15:20 +0100)
committerOleg Drokin <green@whamcloud.com>
Sat, 22 Feb 2025 23:42:04 +0000 (23:42 +0000)
commitb162043239646ca7a26da2146b56578b5ed0d3af
tree4f13f56ff1f37bfd3bcb3ce0cdb5e03bd213765e
parentcf9492e522ecdc6688ad267338725f025fe89a1a
LU-18109 nodemap: fix idmap offset for root

root must be mapped and offset just like other ids, so that all ids on
the client in the range [0, offset_limit-1] are mapped to the
filesystem id range [offset, offset+offset_limit-1].
This means that as soon as an offset is defined on a nodemap, root is
necessarily mapped:
- if admin=1, root id is offset
- if admin=0, root is squashed then offset.
Similarly:
- if trusted=1, ids are mapped (with any explicit mapping) and offset
- if trusted=0, ids are squashed then offset.

Moreover, add_offset and del_offset operations are only allowed on the
MGS or for a dynamic nodemap.

Finally, enhance sanity-sec test_27ab to test id mappings with offset.

Fixes: e3051ad0f1 ("LU-18109 utils: adding nodemap offset capability")
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I7a20c59496174d9d1fc040c5b3b43d8dad3447f9
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57856
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Marc Vef <mvef@whamcloud.com>
lustre/mdt/mdt_lib.c
lustre/ptlrpc/nodemap_handler.c
lustre/tests/sanity-sec.sh