#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
+#include "mount_utils.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <lustre_ver.h>
#include <ctype.h>
#include <limits.h>
-#include "mount_utils.h"
#define MAXOPT 4096
#define MAX_RETRIES 99
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");
* symbolic link for instance
*/
if (realpath(mop->mo_usource, real_path) != NULL) {
- mop->mo_usource = strdup(real_path);
-
ptr = strrchr(real_path, '/');
if (ptr && strncmp(ptr, "/dm-", 4) == 0 && isdigit(*(ptr + 4))) {
snprintf(path, sizeof(path), "/sys/block/%s/dm/name", ptr+1);
fclose(f);
}
}
+ mop->mo_usource = strdup(real_path);
}
ptr = strstr(mop->mo_usource, ":/");
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();
fprintf(stderr, "%s: mount %s at %s failed: %s\n", progname,
mop.mo_usource, mop.mo_target, strerror(errno));
+ if (errno == EBUSY)
+ fprintf(stderr, "Is the backend filesystem mounted?\n"
+ "Check /etc/mtab and /proc/mounts\n");
if (errno == ENODEV)
fprintf(stderr, "Are the lustre modules loaded?\n"
"Check /etc/modprobe.conf and "