X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Futils%2Fmount_lustre.c;h=d1b9f618c9a0afca3f16fc03fc5fea2104671f53;hp=8130da8dec8963f7d12864771b86a9c257928e71;hb=76aa18132e117b2a984edc62e731a4ca9efca4e8;hpb=3f68a0c41ce531475f8a2f407c87d6ae4380c592 diff --git a/lustre/utils/mount_lustre.c b/lustre/utils/mount_lustre.c index 8130da8..d1b9f61 100644 --- a/lustre/utils/mount_lustre.c +++ b/lustre/utils/mount_lustre.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include "obdctl.h" @@ -233,6 +234,9 @@ static const struct opt_map opt_map[] = { { "relatime", 0, MS_RELATIME }, /* set file access time on read */ { "norelatime",1,MS_RELATIME }, /* do not set file access time on read */ #endif +#ifdef MS_STRICTATIME + { "strictatime",0,MS_STRICTATIME }, /* update access time strictly */ +#endif { "auto", 0, 0 }, /* Can be mounted using -a */ { "noauto", 0, 0 }, /* Can only be mounted explicitly */ { "nousers", 1, 0 }, /* Forbid ordinary user to mount */ @@ -304,7 +308,7 @@ int parse_options(char *orig_options, int *flagp) retry = 0; } else if (val && strncmp(arg, "mgssec", 6) == 0) { append_option(options, opt); - } else if (strncmp(opt, "force", 5) == 0) { + } else if (strcmp(opt, "force") == 0) { //XXX special check for 'force' option ++force; printf("force: %d\n", force); @@ -313,6 +317,12 @@ int parse_options(char *orig_options, int *flagp) append_option(options, opt); } } +#ifdef MS_STRICTATIME + /* set strictatime to default if NOATIME or RELATIME + not given explicit */ + if (!(*flagp & (MS_NOATIME | MS_RELATIME))) + *flagp |= MS_STRICTATIME; +#endif strcpy(orig_options, options); free(options); return 0; @@ -453,7 +463,7 @@ set_params: if (verbose) fprintf(stderr, "warning: opening %s: %s\n", real_path, strerror(errno)); - return rc; + return 0; } if (atoi(buf) >= md_stripe_cache_size) @@ -710,9 +720,8 @@ int main(int argc, char *const argv[]) usource, target, strerror(errno)); if (errno == ENODEV) fprintf(stderr, "Are the lustre modules loaded?\n" - "Check /etc/modprobe.conf and /proc/filesystems" - "\nNote 'alias lustre llite' should be removed" - " from modprobe.conf\n"); + "Check /etc/modprobe.conf and " + "/proc/filesystems\n"); if (errno == ENOTBLK) fprintf(stderr, "Do you need -o loop?\n"); if (errno == ENOMEDIUM)