From 2269d27e07cb4dd9c80a770dec45fa6bd22883ab Mon Sep 17 00:00:00 2001 From: Sebastien Buisson Date: Sat, 26 May 2018 01:15:25 +0900 Subject: [PATCH] LU-11057 obd: check '-o network' and peer discovery conflict "-o network=net" client mount option is not taken into account when LNet dynamic peer discovery is active. Check if LNet dynamic peer discovery is active on local node. If it is, return error if "-o network=net" option is specified. This patch will have to be reverted when the incompatibility between "-o network=net" client mount option and LNet dynamic peer discovery is resolved. Signed-off-by: Sebastien Buisson Change-Id: I0520e58b22b7adecf797fbd351506c2f8712dc85 Reviewed-on: https://review.whamcloud.com/32562 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Amir Shehata Reviewed-by: Oleg Drokin --- lnet/include/lnet/api.h | 1 + lnet/lnet/api-ni.c | 13 +++++++++++++ lustre/doc/mount.lustre.8 | 6 ++++++ lustre/obdclass/obd_mount.c | 9 +++++++++ 4 files changed, 29 insertions(+) diff --git a/lnet/include/lnet/api.h b/lnet/include/lnet/api.h index 77afdd3..1ce4a00 100644 --- a/lnet/include/lnet/api.h +++ b/lnet/include/lnet/api.h @@ -211,6 +211,7 @@ int LNetSetLazyPortal(int portal); int LNetClearLazyPortal(int portal); int LNetCtl(unsigned int cmd, void *arg); void LNetDebugPeer(struct lnet_process_id id); +int LNetGetPeerDiscoveryStatus(void); /** @} lnet_misc */ diff --git a/lnet/lnet/api-ni.c b/lnet/lnet/api-ni.c index 9a56605..8ce8136 100644 --- a/lnet/lnet/api-ni.c +++ b/lnet/lnet/api-ni.c @@ -4147,3 +4147,16 @@ out: return rc; } + +/** + * Retrieve peer discovery status. + * + * \retval 1 if lnet_peer_discovery_disabled is 0 + * \retval 0 if lnet_peer_discovery_disabled is 1 + */ +int +LNetGetPeerDiscoveryStatus(void) +{ + return !lnet_peer_discovery_disabled; +} +EXPORT_SYMBOL(LNetGetPeerDiscoveryStatus); diff --git a/lustre/doc/mount.lustre.8 b/lustre/doc/mount.lustre.8 index dfc8c1a..e4a68f0 100644 --- a/lustre/doc/mount.lustre.8 +++ b/lustre/doc/mount.lustre.8 @@ -211,6 +211,12 @@ This option can be useful in case of several Lustre client mount points on the same node, with each mount point using a different network. It is also interesting when running Lustre clients from containers, by restricting each container to a specific network. +.PP +.RS +Warning! 'network' option is incompatible with LNet Dynamic Peer Discovery. +If you want to restrict client NID, please make sure LNet Dynamic Peer Discovery +is disabled. +.RE .SH SERVER OPTIONS In addition to the standard mount options and backing disk type (e.g. ldiskfs) options listed in diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 6bebaf3..b027a8e 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -1414,6 +1414,15 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd) rc = lmd_parse_network(lmd, s1 + 8); if (rc) goto invalid; + + /* check if LNet dynamic peer discovery is activated */ + if (LNetGetPeerDiscoveryStatus()) { + CERROR("LNet Dynamic Peer Discovery is enabled " + "on this node. 'network' mount option " + "cannot be taken into account.\n"); + goto invalid; + } + clear++; } -- 1.8.3.1