The --network= option to mkfs.lustre allows restricting a target
(OST/MDT) to a given LNet network. This makes it register to the MGS
with the specified network only. However, dynamic discovery is unaware
of this restriction and this can create problems.
We prevent mounting with mkfs "network" option if discovery is enabled
by returning an EINVAL error.
Test-Parameters: trivial
Signed-off-by: Cyril Bordage <cbordage@whamcloud.com>
Change-Id: I4b6da7804162192054d7b29a28fbe4cb015e6570
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/46632
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Frank Sehr <fsehr@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet_nid_to_nid4(&id.nid)) < 1)
continue;
+ if (!class_find_param(lsi->lsi_lmd->lmd_params,
+ PARAM_NETWORK, NULL)) {
+ if (LNetGetPeerDiscoveryStatus()) {
+ CERROR("LNet Dynamic Peer Discovery is enabled"
+ " on this node. 'network' option used in"
+ " mkfs.lustre cannot be taken into"
+ " account.\n");
+ RETURN(-EINVAL);
+ }
+ }
+
/* match specified network */
if (!class_match_net(lsi->lsi_lmd->lmd_params,
PARAM_NETWORK, LNET_NID_NET(&id.nid)))