clear_update_ondisk(source, ldd);
/* Since we never rewrite ldd, ignore temp flags */
- ldd->ldd_flags &= ~(LDD_F_VIRGIN | LDD_F_WRITECONF);
+ ldd->ldd_flags &= ~(LDD_F_VIRGIN | LDD_F_WRITECONF |
+ LDD_F_NO_LOCAL_LOGS);
/* This is to make sure default options go first */
temp_options = strdup(options);
} else if (ldd->ldd_svname[rc - 8] == '=') {
ldd->ldd_svname[rc - 8] = '-';
ldd->ldd_flags |= LDD_F_WRITECONF;
+ } else if (ldd->ldd_svname[rc - 8] == '+') {
+ ldd->ldd_svname[rc - 8] = '-';
+ ldd->ldd_flags |= LDD_F_NO_LOCAL_LOGS;
}
}
/* backend osd type */
if (rc != 0)
return rc;
}
+ if (ldd->ldd_flags & LDD_F_NO_LOCAL_LOGS) {
+ rc = append_option(options, options_len, "nolocallogs", NULL);
+ if (rc != 0)
+ return rc;
+ }
if (ldd->ldd_flags & LDD_F_NO_PRIMNODE) {
rc = append_option(options, options_len, "noprimnode", NULL);
if (rc != 0)
if (mop->mo_nosvc)
return;
- if (mop->mo_ldd.ldd_flags & (LDD_F_VIRGIN | LDD_F_WRITECONF)) {
+ if (mop->mo_ldd.ldd_flags & (LDD_F_VIRGIN | LDD_F_WRITECONF |
+ LDD_F_NO_LOCAL_LOGS)) {
(void)osd_label_lustre(mop);
} else {
struct lustre_disk_data ldd;
if (rc)
goto out_osd;
#else
- rc = -EINVAL;
+ rc = EINVAL;
+ fprintf(stderr, "%s: cannot mount %s: no server support\n",
+ progname, mop.mo_usource);
goto out_options;
#endif
}
#endif /* HAVE_GSS */
if (!mop.mo_fake) {
+ char *fstype;
+
+ /* Prefer filesystem type given on mount command line
+ * so it appears correctly in the /proc/mounts output.
+ */
+ if (strstr(argv[0], "mount.lustre_tgt"))
+ fstype = "lustre_tgt";
+ else
+ fstype = "lustre";
/*
* flags and target get to lustre_get_sb(), but not
* lustre_fill_super(). Lustre ignores the flags, but mount
* does not.
*/
for (i = 0, rc = -EAGAIN; i <= mop.mo_retry && rc != 0; i++) {
- rc = mount(mop.mo_source, mop.mo_target, "lustre",
+ rc = mount(mop.mo_source, mop.mo_target, fstype,
flags, (void *)options);
if (rc != 0) {
if (verbose) {
fprintf(stderr,
- "%s: mount %s at %s failed: %s retries left: %d\n",
- basename(progname),
+ "%s: mount -t %s %s at %s failed: %s retries left: %d\n",
+ basename(progname), fstype,
mop.mo_usource, mop.mo_target,
strerror(errno),
mop.mo_retry - i);
}
+ /* Pre-2.13 Lustre without 'lustre_tgt' type?
+ * Try with 'lustre' instead. Eventually this
+ * can be removed (e.g. 2.18 or whenever).
+ */
+ if (errno == ENODEV &&
+ strcmp(fstype, "lustre_tgt") == 0) {
+ fstype = "lustre";
+ i--;
+ continue;
+ }
+
if (mop.mo_retry) {
int limit = i / 2 > 5 ? i / 2 : 5;