X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Futils%2Fmount_lustre.c;h=5890e5fc8aa658733d76184836e961af84534270;hp=a966613c93d6f1bf79a766e8ce6fa105d7b7d875;hb=refs%2Fchanges%2F74%2F40474%2F3;hpb=bde0ebd6a3e88de5b8d7681efe5d67b98e7fe6a0 diff --git a/lustre/utils/mount_lustre.c b/lustre/utils/mount_lustre.c index a966613..5890e5f 100644 --- a/lustre/utils/mount_lustre.c +++ b/lustre/utils/mount_lustre.c @@ -962,8 +962,15 @@ int main(int argc, char *const argv[]) #endif /* HAVE_GSS */ if (!mop.mo_fake) { - char *fstype = client ? "lustre" : "lustre_tgt"; + 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 @@ -973,24 +980,26 @@ int main(int argc, char *const argv[]) rc = mount(mop.mo_source, mop.mo_target, fstype, flags, (void *)options); if (rc != 0) { - /* Older Lustre without 'lustre_tgt'. - * Try 'lustre' instead - */ - if (rc == -ENODEV) { - fstype = "lustre"; - i--; - continue; - } - 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 (rc == -ENODEV && + strcmp(fstype, "lustre_tgt") == 0) { + fstype = "lustre"; + i--; + continue; + } + if (mop.mo_retry) { int limit = i / 2 > 5 ? i / 2 : 5;