Whamcloud - gitweb
LU-1279 utils: mount.lustre load ptlrpc module if necessary
[fs/lustre-release.git] / lustre / utils / mount_lustre.c
index 042fac1..374815e 100644 (file)
@@ -42,6 +42,7 @@
 #ifndef _GNU_SOURCE
 #define _GNU_SOURCE
 #endif
+#include "mount_utils.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
@@ -52,7 +53,6 @@
 #include <lustre_ver.h>
 #include <ctype.h>
 #include <limits.h>
-#include "mount_utils.h"
 
 #define MAXOPT 4096
 #define MAX_RETRIES 99
@@ -364,8 +364,6 @@ static int parse_ldd(char *source, struct mount_opts *mop, char *options)
                append_option(options, "virgin");
        if (ldd->ldd_flags & LDD_F_WRITECONF)
                append_option(options, "writeconf");
-       if (ldd->ldd_flags & LDD_F_IAM_DIR)
-               append_option(options, "iam");
        if (ldd->ldd_flags & LDD_F_NO_PRIMNODE)
                append_option(options, "noprimnode");
 
@@ -516,6 +514,12 @@ int main(int argc, char *const argv[])
        progname = strrchr(argv[0], '/');
        progname = progname ? progname + 1 : argv[0];
 
+       /*
+        * LU-1279. When LNET modules have not loaded, and mounting multiple
+        * targets at the same time could fail.
+        */
+       rc = system("/sbin/modprobe ptlrpc 2>&1 > /dev/null");
+
        set_defaults(&mop);
 
        rc = osd_init();