Whamcloud - gitweb
LU-11057 obd: check '-o network' and peer discovery conflict 62/32562/5
authorSebastien Buisson <sbuisson@ddn.com>
Fri, 25 May 2018 16:15:25 +0000 (01:15 +0900)
committerOleg Drokin <green@whamcloud.com>
Tue, 4 Sep 2018 03:48:33 +0000 (03:48 +0000)
"-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 <sbuisson@ddn.com>
Change-Id: I0520e58b22b7adecf797fbd351506c2f8712dc85
Reviewed-on: https://review.whamcloud.com/32562
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/include/lnet/api.h
lnet/lnet/api-ni.c
lustre/doc/mount.lustre.8
lustre/obdclass/obd_mount.c

index 77afdd3..1ce4a00 100644 (file)
@@ -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 */
 
index 9a56605..8ce8136 100644 (file)
@@ -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);
index dfc8c1a..e4a68f0 100644 (file)
@@ -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
index 6bebaf3..b027a8e 100644 (file)
@@ -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++;
                }