Whamcloud - gitweb
LU-13306 mgc: handle large NID formats 50/50750/23
authorJames Simmons <jsimmons@infradead.org>
Thu, 24 Aug 2023 23:11:55 +0000 (19:11 -0400)
committerOleg Drokin <green@whamcloud.com>
Sat, 23 Sep 2023 06:01:30 +0000 (06:01 +0000)
commite4d2d4ff74a103e4288d7581b40020eaff22b139
treec6bec8ffae539ea9e4b1e359665a70ba79da7391
parent14ed4a6f8f231fe94392906f991a32f07e7d7883
LU-13306 mgc: handle large NID formats

For newer versions of Lustre the MGS can send mgs_nidtbl_entry
containing NIDs of a larger format. Its also possible an old
MGS will send NIDs of the previous size. We need to handle
both cases. We reused the field of mcb_nm_cur_pass, which only
is used for nodemap, of the struct mgs_config_body to send the
NID size from the client to the MGS. Pre IPv6 clients will
by default have a zero mcb_nm_cur_pass / mcb_nid_size. When
mcb_nid_size is zero the the MGS will treat the client as
pre-IPv6 and send small NID back to the client. This avoids
needing to patch older clients. If the MGS is older then
small size NIDs will be sent back which the new MGC layer can
handle by converting those lnet_nid_t to struct lnet_nid.

To handle this new code the "swab" of the entry is split into
two parts. The "header" is "swab"ed as soon as we know the entry
is large enough for that to make sense. The content containing
NID information is swabbed later once the header has been found
to look sane.

Test-Parameters: serverversion=2.15 testlist=runtests,sanity,recovery-small
Change-Id: I97ebdcecc1ee0fbfe676cbdbdc77edee13e60891
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50750
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
12 files changed:
lustre/include/lustre_net.h
lustre/include/lustre_swab.h
lustre/include/obd_class.h
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/ldlm/ldlm_lib.c
lustre/mgc/mgc_request.c
lustre/mgs/mgs_nids.c
lustre/obdclass/lustre_peer.c
lustre/ptlrpc/pack_generic.c
lustre/ptlrpc/wiretest.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c