From a9b6e521a155244d7d702e986ad92613276f0a3c Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 15 Jun 2006 22:20:49 +0000 Subject: [PATCH] Branch b1_5 b=9861 - turn on extents, mballoc on OSTs by default - don't try to pre-check lustre/llite/ldiskfs options in mount.lustre. Instead, just let the mount call fail. --- lustre/doc/mount.lustre.8 | 8 ++++- lustre/llite/llite_internal.h | 1 - lustre/llite/llite_lib.c | 19 +++++++----- lustre/utils/mkfs_lustre.c | 7 ++--- lustre/utils/mount_lustre.c | 69 +++++++++++++++++++------------------------ 5 files changed, 51 insertions(+), 53 deletions(-) diff --git a/lustre/doc/mount.lustre.8 b/lustre/doc/mount.lustre.8 index d05a681..3e830a9 100644 --- a/lustre/doc/mount.lustre.8 +++ b/lustre/doc/mount.lustre.8 @@ -40,7 +40,8 @@ The mgs specification may be a colon-separated list of nodes... ...and each node may be specified by a comma-separated list of NIDs. .PP In addition to the standard mount options, Lustre understands the following -additional options: +.I client-specific +options: .TP .BI flock Enable flock support @@ -59,6 +60,11 @@ Enable ACL support .TP .BI noacl Disable ACL support +.PP +In addition to the standard mount options and backing disk type +(e.g. LDISKFS) options, Lustre understands the following +.I server-specific +options: .TP .BI nosvc Only start the MGC (and MGS, if co-located) for a target service, and not the actual service. diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index f9846e9..443bfc1 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -460,7 +460,6 @@ int revalidate_it_finish(struct ptlrpc_request *request, int offset, extern struct super_operations lustre_super_operations; char *ll_read_opt(const char *opt, char *data); -void ll_options(char *options, int *flags); void ll_lli_init(struct ll_inode_info *lli); int ll_fill_super(struct super_block *sb); void ll_put_super(struct super_block *sb); diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 2fcd45c..8126d16 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -576,16 +576,14 @@ static inline int ll_set_opt(const char *opt, char *data, int fl) } /* non-client-specific mount options are parsed in lmd_parse */ -void ll_options(char *options, int *flags) +static int ll_options(char *options, int *flags) { int tmp; char *s1 = options, *s2; ENTRY; - if (!options) { - EXIT; - return; - } + if (!options) + RETURN(0); CDEBUG(D_CONFIG, "Parsing opts %s\n", options); @@ -628,6 +626,9 @@ void ll_options(char *options, int *flags) goto next; } + LCONSOLE_ERROR("Unknown option '%s', won't mount.\n", s1); + RETURN(-EINVAL); + next: /* Find next opt */ s2 = strchr(s1, ','); @@ -635,7 +636,7 @@ next: break; s1 = s2 + 1; } - EXIT; + RETURN(0); } void ll_lli_init(struct ll_inode_info *lli) @@ -849,8 +850,10 @@ int ll_fill_super(struct super_block *sb) if (!sbi) RETURN(-ENOMEM); - ll_options(lsi->lsi_lmd->lmd_opts, &sbi->ll_flags); - + err = ll_options(lsi->lsi_lmd->lmd_opts, &sbi->ll_flags); + if (err) + GOTO(out_free, err); + /* Generate a string unique to this super, in case some joker tries to mount the same fs at two mount points. Use the address of the super itself.*/ diff --git a/lustre/utils/mkfs_lustre.c b/lustre/utils/mkfs_lustre.c index d2ad752..ebdc26d 100644 --- a/lustre/utils/mkfs_lustre.c +++ b/lustre/utils/mkfs_lustre.c @@ -1174,14 +1174,13 @@ int main(int argc, char *const argv[]) ",iopen_nopriv,user_xattr"); if ((get_os_version() == 24) && IS_OST(ldd)) strcat(always_mountopts, ",asyncdel"); -#if 0 - /* Files created while extents are enabled cannot be read if - mounted with a kernel that doesn't include the CFS patches.*/ + /* NB: Files created while extents are enabled cannot be read + if mounted with a kernel that doesn't include the CFS + patches! */ if (IS_OST(ldd) && ldd->ldd_mount_type == LDD_MT_LDISKFS) { strcat(default_mountopts, ",extents,mballoc"); } -#endif break; } case LDD_MT_SMFS: { diff --git a/lustre/utils/mount_lustre.c b/lustre/utils/mount_lustre.c index 8429995..85ca11e 100644 --- a/lustre/utils/mount_lustre.c +++ b/lustre/utils/mount_lustre.c @@ -46,6 +46,8 @@ static char *progname = NULL; void usage(FILE *out) { fprintf(out, "%s v"LUSTRE_VERSION_STRING"\n", progname); + fprintf(out, "\nThis mount helper should only be invoked via the " + "mount (8) command,\ne.g. mount -t lustre dev dir\n\n"); fprintf(out, "usage: %s [-fhnv] [-o ] \n", progname); fprintf(out, @@ -162,48 +164,36 @@ out_free: ****************************************************************************/ struct opt_map { const char *opt; /* option name */ - int skip; /* don't pass this option to Lustre */ int inv; /* true if flag value should be inverted */ int mask; /* flag mask value */ }; static const struct opt_map opt_map[] = { - /*"optname",skip,inv,ms_mask */ + /*"optname", inv,ms_mask */ /* These flags are parsed by mount, not lustre */ - { "defaults", 1, 0, 0 }, /* default options */ - { "remount", 1, 0, MS_REMOUNT}, /* remount with different options */ - { "rw", 1, 1, MS_RDONLY }, /* read-write */ - { "ro", 1, 0, MS_RDONLY }, /* read-only */ - { "exec", 1, 1, MS_NOEXEC }, /* permit execution of binaries */ - { "noexec", 1, 0, MS_NOEXEC }, /* don't execute binaries */ - { "suid", 1, 1, MS_NOSUID }, /* honor suid executables */ - { "nosuid", 1, 0, MS_NOSUID }, /* don't honor suid executables */ - { "dev", 1, 1, MS_NODEV }, /* interpret device files */ - { "nodev", 1, 0, MS_NODEV }, /* don't interpret devices */ - { "async", 1, 1, MS_SYNCHRONOUS}, /* asynchronous I/O */ - { "auto", 1, 0, 0 }, /* Can be mounted using -a */ - { "noauto", 1, 0, 0 }, /* Can only be mounted explicitly */ - { "nousers", 1, 1, 0 }, /* Forbid ordinary user to mount */ - { "nouser", 1, 1, 0 }, /* Forbid ordinary user to mount */ - { "noowner", 1, 1, 0 }, /* Device owner has no special privs */ - { "_netdev", 1, 0, 0 }, /* Device accessible only via network */ - /* These flags are passed through and parsed in lmd_parse & ll_options */ - { "flock", 0, 0, 0 }, /* Enable flock support */ - { "noflock", 0, 1, 0 }, /* Disable flock support */ - { "user_xattr", 0, 0, 0 }, /* Enable get/set user xattr */ - { "nouser_xattr", 0, 1, 0 }, /* Disable user xattr */ - { "acl", 0, 0, 0 }, /* Enable ACL support */ - { "noacl", 0, 1, 0 }, /* Disable ACL support */ - { "nosvc", 0, 0, 0 }, /* Only start MGS/MGC, nothing else */ - { "exclude", 0, 0, 0 }, /* OST exclusion list */ - { "abort_recov", 0, 0, 0 }, /* Abort recovery */ - { NULL, 0, 0, 0 } + { "defaults", 0, 0 }, /* default options */ + { "remount", 0, MS_REMOUNT}, /* remount with different options */ + { "rw", 1, MS_RDONLY }, /* read-write */ + { "ro", 0, MS_RDONLY }, /* read-only */ + { "exec", 1, MS_NOEXEC }, /* permit execution of binaries */ + { "noexec", 0, MS_NOEXEC }, /* don't execute binaries */ + { "suid", 1, MS_NOSUID }, /* honor suid executables */ + { "nosuid", 0, MS_NOSUID }, /* don't honor suid executables */ + { "dev", 1, MS_NODEV }, /* interpret device files */ + { "nodev", 0, MS_NODEV }, /* don't interpret devices */ + { "async", 1, MS_SYNCHRONOUS}, /* asynchronous I/O */ + { "auto", 0, 0 }, /* Can be mounted using -a */ + { "noauto", 0, 0 }, /* Can only be mounted explicitly */ + { "nousers", 1, 0 }, /* Forbid ordinary user to mount */ + { "nouser", 1, 0 }, /* Forbid ordinary user to mount */ + { "noowner", 1, 0 }, /* Device owner has no special privs */ + { "_netdev", 0, 0 }, /* Device accessible only via network */ + { NULL, 0, 0 } }; /****************************************************************************/ -/* 1 = found, skip - 0 = found, no skip - -1 = not found in above list */ +/* 1 = don't pass on to lustre + 0 = pass on to lustre */ static int parse_one_option(const char *check, int *flagp) { const struct opt_map *opt; @@ -216,12 +206,12 @@ static int parse_one_option(const char *check, int *flagp) else *flagp |= opt->mask; } - return opt->skip; + return 1; } } - fprintf(stderr, "%s: ignoring unknown option '%s'\n", progname, - check); - return -1; + /* Assume any unknown options are valid and pass them on. The mount + will fail if lmd_parse, ll_options or ldiskfs doesn't recognize it.*/ + return 0; } /* Replace options with subset of Lustre-specific options, and @@ -409,8 +399,9 @@ int main(int argc, char *const argv[]) "in use. (%s)\n", source); if (errno == EINVAL) { char *ptr = strchr(source, '/'); - fprintf(stderr, "This may have multiple causes. Is " - "'%s' the correct filesystem name?\n", + fprintf(stderr, "This may have multiple causes.\n" + "Is '%s' the correct filesystem name?\n" + "Are the mount options correct?\n", ptr ? ptr + 1 : source); fprintf(stderr, "Check the syslog for more info\n"); } -- 1.8.3.1